WriterOutputStream extends OutputStream { @Override public void close() throws IOException { _decode(_inputByteBuffer, true); _flushBuffer(); _writer.close(); } WriterOutputStream(Writer writer);  WriterOutputStream(Writer writer, String charsetName);  WriterOutputStream(
		Writer writer, String charsetName, boolean autoFlush);  WriterOutputStream(
		Writer writer, String charsetName, int outputBufferSize);  WriterOutputStream(
		Writer writer, String charsetName, int outputBufferSize,
		boolean autoFlush); @Override void close(); @Override void flush(); String getEncoding(); @Override void write(byte[] bytes); @Override void write(byte[] bytes, int offset, int length); @Override void write(int b);  }
@Test public void testClose() throws IOException { final AtomicBoolean closeAtomicBoolean = new AtomicBoolean(); DummyWriter dummyWriter = new DummyWriter() { @Override public void close() { closeAtomicBoolean.set(true); } }; try (WriterOutputStream writerOutputStream = new WriterOutputStream( dummyWriter)) { Assert.assertFalse(closeAtomicBoolean.get()); } Assert.assertTrue(closeAtomicBoolean.get()); }