public static LeafReader wrap(IndexReader reader) throws IOException {
        if (reader instanceof CompositeReader) {
            return new SlowCompositeReaderWrapper((CompositeReader) reader);
        } else {
            assert reader instanceof LeafReader;
            return (LeafReader) reader;
        }
    }
This method is sugar for getting an {@link LeafReader} from
an {@link IndexReader} of any kind. If the reader is already atomic,
it is returned unchanged, otherwise wrapped by this class.
tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/tools/SlowCompositeReaderWrapper.java