### Question:
IOUtils { public static InputStream toInputStream(final String str, final Charset charset) { return new ByteArrayInputStream(str.getBytes(charset)); } IOUtils(); static byte[] toByteArray(final InputStream input); static InputStream toInputStream(final String str, final Charset charset); static String toString(final InputStream input, final Charset charset); static void copy(final InputStream input, final OutputStream output);  }### Answer:
@Test public void testToInputStream() throws IOException { final InputStream input = IOUtils.toInputStream("test", StandardCharsets.UTF_8); assertEquals("test", IOUtils.toString(input, StandardCharsets.UTF_8)); }