### Question:
CloseShieldOutputStream extends ProxyOutputStream { @Override public void close() { out = new ClosedOutputStream(); } CloseShieldOutputStream(final OutputStream out); @Override void close();  }### Answer:
@Test public void testClose() throws IOException { shielded.close(); assertFalse("closed", closed); try { shielded.write('x'); fail("write(b)"); } catch (final IOException ignore) { } original.write('y'); assertEquals(1, original.size()); assertEquals('y', original.toByteArray()[0]); }