private Map<String, String> getTestLanguages(String resourceName) throws IOException {
        Map<String, String> result = new HashMap<>();
        List<String> languages =
                IOUtils.readLines(OptimaizeLangDetectorTest.class.getResourceAsStream(resourceName),
                        StandardCharsets.UTF_8);
        for (String line : languages) {
            line = line.trim();
            if (line.isEmpty() || line.startsWith("#")) {
                continue;
            }

            String[] pieces = line.split("\t", 2);
            if (pieces.length != 2) {
                throw new IllegalArgumentException("Invalid language data line: " + line);
            }

            result.put(pieces[0], pieces[1]);
        }

        return result;
    }
Test correct detection for the many (short) translations of the
"Universal Declaration of Human Rights (Article 1)", at
http://www.omniglot.com/udhr
<p>
Also make sure we get uncertain results for some set of unsupported
languages.

@throws Exception
tika-langdetect/tika-langdetect-optimaize/src/test/java/org/apache/tika/langdetect/optimaize/OptimaizeLangDetectorTest.java