LanguageIdentifier { public boolean isReasonablyCertain() { return distance < CERTAINTY_LIMIT; } LanguageIdentifier(LanguageProfile profile);  LanguageIdentifier(String content); static void addProfile(String language, LanguageProfile profile); String getLanguage(); boolean isReasonablyCertain(); static void initProfiles(); static void initProfiles(Map<String, LanguageProfile> profilesMap); static void clearProfiles(); static boolean hasErrors(); static String getErrors(); static Set<String> getSupportedLanguages(); @Override String toString();  }
@Test public void testMixedLanguages() throws IOException { for (String language : languages) { for (String other : languages) { if (!language.equals(other)) { if (language.equals("lt") || other.equals("lt")) { continue; } ProfilingWriter writer = new ProfilingWriter(); writeTo(language, writer); writeTo(other, writer); LanguageIdentifier identifier = null; identifier = new LanguageIdentifier(writer.getProfile()); assertFalse("mix of " + language + " and " + other + " incorrectly detected as " + identifier, identifier.isReasonablyCertain()); } } } }