boolean (@NotNull final Language language) { for (String knownLanguageId : knownLanguageIdSet) { Language knownLanguage = Language.findLanguageByID(knownLanguageId); if (knownLanguage != null && (language.is(knownLanguage) || knownLanguage.getDialects().contains(language))) { return true; } } return false; }