@Test
    public void testOptionalHyphen() throws Exception {
        String[] extensions = new String[]{"ppt", "pptx", "doc", "docx", "rtf", "pdf"};
        for (String extension : extensions) {
            try (TikaInputStream tis = TikaInputStream
                    .get(getResourceAsStream("/test-documents/testOptionalHyphen." + extension))) {

                String content = TIKA.parseToString(tis.getFile());
                assertTrue(content.contains("optionalhyphen") ||
                                        content.contains("optional\u00adhyphen") ||   // soft hyphen
                                        content.contains("optional\u200bhyphen") ||   // zero width space
                                        content.contains("optional\u2027"),
                        "optional hyphen was not handled for '" + extension + "' file type: " +
                                        content);          // hyphenation point
            }
        }

    }
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