### Question:
CloseShieldInputStream extends ProxyInputStream { @Override public void close() { in = new ClosedInputStream(); } CloseShieldInputStream(final InputStream in); @Override void close();  }### Answer:
@Test public void testClose() throws IOException { shielded.close(); assertFalse("closed", closed); assertEquals("read()", -1, shielded.read()); assertEquals("read()", data[0], original.read()); }