UnsyncBufferedInputStream extends UnsyncFilterInputStream { @Override public void close() throws IOException { if (inputStream != null) { inputStream.close(); inputStream = null; _buffer = null; } } UnsyncBufferedInputStream(InputStream inputStream);  UnsyncBufferedInputStream(InputStream inputStream, int size); @Override int available(); @Override void close(); @Override void mark(int readLimit); @Override boolean markSupported(); @Override int read(); @Override int read(byte[] bytes); @Override int read(byte[] bytes, int offset, int length); @Override void reset(); @Override long skip(long skip);  }
@Test public void testClose() throws Exception { int size = 10; UnsyncBufferedInputStream unsyncBufferedInputStream = new UnsyncBufferedInputStream( new ByteArrayInputStream(new byte[size])); unsyncBufferedInputStream.close(); Assert.assertNull(unsyncBufferedInputStream.inputStream); Assert.assertNull(_bufferField.get(unsyncBufferedInputStream)); testClose(unsyncBufferedInputStream, "Input stream is null"); }