IOUtils { public static void write(String str, OutputStream out) throws IOException { out.write(str.getBytes()); } private  IOUtils(); static void copy(InputStream input, OutputStream output); static void write(String str, OutputStream out); static String toString(InputStream input); static void closeQuietly(InputStream is); static void consumeAndClose(InputStream is); static InputStream getResourceAsStream(String name); static String getResourceAsString(String name); static byte[] readToBytes(InputStream inputStream); static File getFile(String classPathLocation);  }
@Test public void testWrite() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOUtils.write("test", baos); Assert.assertEquals("test", baos.toString()); }