private void verifyComment(String extension, String fileName) throws Exception {
        String content = null;
        try (TikaInputStream tis = TikaInputStream
                .get(getResourceAsStream("/test-documents/" + fileName + "." + extension))) {
            content = TIKA.parseToString(tis.getFile());
        }
        assertTrue(content.contains("Here is some text"),
                extension + ": content=" + content + " did not extract text");
        assertTrue(content.contains("Here is a comment"),
                extension + ": content=" + content + " did not extract comment");
    }
Junit test class for Tika {@link Parser}s.
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/parser/TestParsers.java