### Question:
LocalizedString extends Base { @JsonIgnore public static LocalizedString of() { return of(emptyMap()); } @JsonCreator private  LocalizedString(final Map<Locale, String> translations); @JsonIgnore static LocalizedString of(); static LocalizedString empty(); @JsonIgnore static LocalizedString of(final Locale locale, final String value); @JsonIgnore static LocalizedString of(final Locale locale1, final String value1, final Locale locale2, final String value2); @JsonIgnore static LocalizedString of(final Map<Locale, String> translations); @JsonIgnore static LocalizedString ofStringToStringMap(final Map<String, String> translations); LocalizedString plus(final Locale locale, final String value); @Nonnull Optional<String> find(final Locale locale); @Nullable String get(final Locale locale); @Nullable String get(final String languageTag); @Nonnull Optional<String> find(final Iterable<Locale> locales); @Nullable String get(final Iterable<Locale> locales); @Nullable String getTranslation(final Iterable<Locale> locales); LocalizedString mapValue(final BiFunction<Locale, String, String> function); Stream<LocalizedStringEntry> stream(); static Collector<LocalizedStringEntry, ?, LocalizedString> streamCollector(); LocalizedString slugified(); LocalizedString slugifiedUnique(); @JsonIgnore @Nonnull Set<Locale> getLocales(); @Override String toString(); static TypeReference<LocalizedString> typeReference(); static LocalizedString ofEnglish(final String translationForEnglish);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void throwIllegalArgumentExceptionOnDuplicateKeysWithCreator() throws Exception { LocalizedString.of(Locale.GERMAN, DEFAULT_STRING_1, Locale.GERMAN, DEFAULT_STRING_2); }
@Test public void jsonSerialize() throws Exception { assertThat(SphereJsonUtils.newObjectMapper().writeValueAsString(LocalizedString.of(Locale.GERMAN, "Hundefutter", Locale.ENGLISH, "dog food"))).isEqualTo(DOG_FOOD_JSON); }
@Test public void jsonDeserialize() throws Exception { assertThat(SphereJsonUtils.newObjectMapper().readValue(DOG_FOOD_JSON, LocalizedString.class)).isEqualTo(LocalizedString.of(Locale.GERMAN, "Hundefutter", Locale.ENGLISH, "dog food")); }
@Test public void deserializeWithFullLocale() { final LocalizedString localizedString = LocalizedString.of(Locale.US, "kids", Locale.UK, "children"); assertThat(SphereJsonUtils.toJsonNode(localizedString)).isEqualTo(SphereJsonUtils.parse(FULL_LOCALE_JSON_STRING)); }