### Question:
Streams { @Deprecated public static String readAll(final InputStream inputStream) throws IOException { return readAll(inputStream, Charset.defaultCharset()); } private  Streams(); @Deprecated static InputStream wrapString(String str); static InputStream wrapString(String str, Charset charset); @Deprecated static String readAll(final InputStream inputStream); static String readAll(final InputStream inputStream, Charset charset); @Deprecated static void write(String str, final OutputStream outputStream); static void write(String str, final OutputStream outputStream, Charset charset); static void copy(final InputStream inputStream, final OutputStream outputStream);  }### Answer:
@SuppressWarnings({"deprecation", "javadoc"}) @Test public void testReadAll() throws Exception { String testString = "Testing©ÿ»"; String actual = Streams.readAll(new ByteArrayInputStream(testString.getBytes(Charset.defaultCharset()))); String expected = new String(testString.getBytes(Charset.defaultCharset()), Charset.defaultCharset()); assertEquals(expected, actual); }
@Test public void testReadAll_wrongCharset() throws Exception { String testString = "Testing©ÿ»"; String actual = Streams.readAll( new ByteArrayInputStream(testString.getBytes(Charset.forName(UTF_8))), Charset.forName(ISO_8859_1)); assertFalse("String should not be equal", testString.equals(actual)); }
@Test public void testReadAll_sameCharset() throws Exception { String testString = "Testing©ÿ»"; String actual = Streams.readAll( new ByteArrayInputStream(testString.getBytes(Charset.forName(UTF_8))), Charset.forName(UTF_8)); assertEquals(testString, actual); }