### Question:
WriterOutputStream extends OutputStream { @Override public void flush() throws IOException { flushOutput(); writer.flush(); } WriterOutputStream(final Writer writer, final CharsetDecoder decoder);  WriterOutputStream(final Writer writer, final CharsetDecoder decoder, final int bufferSize,
                              final boolean writeImmediately);  WriterOutputStream(final Writer writer, final Charset charset, final int bufferSize,
                              final boolean writeImmediately);  WriterOutputStream(final Writer writer, final Charset charset);  WriterOutputStream(final Writer writer, final String charsetName, final int bufferSize,
                              final boolean writeImmediately);  WriterOutputStream(final Writer writer, final String charsetName); @Deprecated  WriterOutputStream(final Writer writer); @Override void write(final byte[] b, int off, int len); @Override void write(final byte[] b); @Override void write(final int b); @Override void flush(); @Override void close();  }### Answer:
@Test public void testFlush() throws IOException { final StringWriter writer = new StringWriter(); final WriterOutputStream out = new WriterOutputStream(writer, "us-ascii", 1024, false); out.write("abc".getBytes("us-ascii")); assertEquals(0, writer.getBuffer().length()); out.flush(); assertEquals("abc", writer.toString()); out.close(); }