@Test
    public void testMixedLanguages() throws IOException {
        LanguageDetector detector = new OptimaizeLangDetector().setMixedLanguages(true);

        detector.loadModels();
        LanguageWriter writer = new LanguageWriter(detector);

        String[] languages = getTestLanguages();
        for (int i = 0; i < languages.length; i++) {
            String language = languages[i];
            for (int j = i + 1; j < languages.length; j++) {
                String other = languages[j];

                writer.reset();
                writeTo(language, writer);
                writeTo(other, writer);

                List<LanguageResult> results = detector.detectAll();
                if (results.size() > 0) {
                    LanguageResult result = results.get(0);

                    assertFalse(result.isReasonablyCertain(),
                            "mix of " + language + " and " + other + " incorrectly detected as " +
                                    result);
                }
            }
        }

        writer.close();
    }
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