private static String[] getRealWords(String string) {
        String[] possibleWords = string.split("\\s+");
        List<String> words = new ArrayList<>(possibleWords.length);
        for (String word : possibleWords) {
            if (word.length() > 0) {
                words.add(word);
            }
        }

        return words.toArray(new String[0]);
    }
Return array of non-zerolength words. Splitting on whitespace will get us
empty words for emptylines.

@param string some mix of newlines and real words
@return array of real words.
tika-core/src/test/java/org/apache/tika/sax/XHTMLContentHandlerTest.java