@Test
    public void testTailChunkReads() throws IOException {
        final int count = 16384;
        final int tailSize = 61;
        final int bufSize = 100;
        TailStream stream = new TailStream(generateStream(0, count), tailSize);
        byte[] buf = new byte[bufSize];
        int read = stream.read(buf, 10, 8);
        assertEquals(8, read, "Wrong number of bytes read");
        while (read != -1) {
            read = stream.read(buf);
        }
        assertEquals(generateText(count - tailSize, tailSize),
                new String(stream.getTail(), UTF_8), "Wrong buffer");
        stream.close();
    }
Tests the content of the tail buffer if larger chunks are read.
tika-core/src/test/java/org/apache/tika/io/TailStreamTest.java