SemanticTags { public static @Nullable Class<? extends Tag> getByLabel(String tagLabel, Locale locale) { Optional<Class<? extends Tag>> tag = TAGS.values().stream().distinct() .filter(t -> getLabel(t, locale).equalsIgnoreCase(tagLabel)).findFirst(); return tag.isPresent() ? tag.get() : null; }  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 testByLabel() { assertEquals(Kitchen.class, SemanticTags.getByLabel("Kitchen", Locale.ENGLISH)); assertEquals(Kitchen.class, SemanticTags.getByLabel("Küche", Locale.GERMAN)); assertNull(SemanticTags.getByLabel("Badezimmer", Locale.GERMAN)); }