SemanticTags { public static List<Class<? extends Tag>> getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale) { return TAGS.values().stream().distinct() .filter(t -> getLabelAndSynonyms(t, locale).contains(tagLabelOrSynonym.toLowerCase(locale))) .collect(Collectors.toList()); }  static @Nullable Class<? extends Tag> getById(String tagId); static @Nullable Class<? extends Tag> getByLabel(String tagLabel, Locale locale); static List<Class<? extends Tag>> getByLabelOrSynonym(String tagLabelOrSynonym, Locale locale); static List<String> getLabelAndSynonyms(Class<? extends Tag> tag, Locale locale); static String getLabel(Class<? extends Tag> tag, Locale locale); static @Nullable Class<? extends Tag> getSemanticType(Item item); @SuppressWarnings("unchecked") static @Nullable Class<? extends Property> getProperty(Item item);  }
@Test public void testByLabelOrSynonym() { assertEquals(Kitchen.class, SemanticTags.getByLabelOrSynonym("Kitchen", Locale.ENGLISH).iterator().next()); assertEquals(Kitchen.class, SemanticTags.getByLabelOrSynonym("Küche", Locale.GERMAN).iterator().next()); assertEquals(Bathroom.class, SemanticTags.getByLabelOrSynonym("Badezimmer", Locale.GERMAN).iterator().next()); }