### Question:
IOUtil { public static void write(final String data, final OutputStream output) throws IOException { if (data != null) { output.write(data.getBytes(Charsets.UTF_8)); } }  static void closeQuietly(Closeable closeable); static String toString(InputStream input); static String toString(Reader input); static List<String> toLines(final InputStream input); static List<String> toLines(final Reader input); static String readLine(final InputStream input); static String readLine(final Reader reader); static void write(final String data, final OutputStream output); static void write(final String data, final Writer output); static InputStream toInputStream(String input); static Reader toInputStreamReader(String input); static long copy(final Reader input, final Writer output); static long copy(final InputStream input, final OutputStream output); static BufferedReader toBufferedReader(final Reader reader);  }### Answer:
@Test public void write() throws IOException { StringBuilderWriter sw = new StringBuilderWriter(); IOUtil.write("hahahaha", sw); assertThat(sw.toString()).isEqualTo("hahahaha"); ByteArrayOutputStream out = new ByteArrayOutputStream(); IOUtil.write("hahahaha", out); assertThat(new String(out.toByteArray(), Charsets.UTF_8)).isEqualTo("hahahaha"); IOUtil.closeQuietly(out); IOUtil.closeQuietly((Closeable) null); }