boolean (@NotNull Set<String> elementDialectIds, @NotNull Language language, boolean applyToDialects) { if (elementDialectIds.contains(language.getID())) { return true; } if (applyToDialects) { for (Language dialect : language.getTransitiveDialects()) { if (elementDialectIds.contains(dialect.getID())) { return true; } } } return false; }