void () { Collection<Language> languages = Language.getRegisteredLanguages(); Map<String, Language> displayNames = new HashMap<>(); for (Language language : languages) { Language prev = displayNames.put(language.getDisplayName(), language); if (prev != null) { fail("The languages '%s' (%s) and '%s' (%s) have the same display name '%s'" .formatted(prev, prev.getClass().getName(), language, language.getClass().getName(), language.getDisplayName())); } } }