@Test
    public void testReadWithMarkAndReset() throws IOException {
        final int tailSize = 64;
        TailStream stream = new TailStream(generateStream(0, 2 * tailSize), tailSize);
        byte[] buf = new byte[tailSize / 2];
        stream.read(buf);
        stream.mark(tailSize);
        stream.read(buf);
        stream.reset();
        readStream(stream);
        assertEquals(generateText(tailSize, tailSize),
                new String(stream.getTail(), UTF_8), "Wrong buffer");
    }
Tests whether mark() and reset() work as expected.
tika-core/src/test/java/org/apache/tika/io/TailStreamTest.java