private void doACloseBehaviorTest(boolean wantToClose) throws IOException {

        TestInputStream tis = createTestInputStream(DEFAULT_TEST_SIZE);
        RereadableInputStream ris = new RereadableInputStream(tis, MEMORY_THRESHOLD, wantToClose);
        ris.close();
        assertEquals(wantToClose, tis.isClosed());

        if (!tis.isClosed()) {
            tis.close();
        }
    }
Read increasingly more of the stream, but not all, with each pass before rewinding to
make sure we pick up at the correct point
tika-core/src/test/java/org/apache/tika/TestRereadableInputStream.java