ThirdPartyService { Map<String, String> parseLocaleMapping(String input) { return Optional.ofNullable(localeMappingHelper.getInverseLocaleMapping(Strings.emptyToNull(input))) .orElseGet(Collections::emptyMap); }  PollableFuture<Void> asyncSyncMojitoWithThirdPartyTMS(ThirdPartySync thirdPartySync);  }
@Test public void testParseLocaleMapping() { assertThat(thirdPartyService.parseLocaleMapping(null)).isEmpty(); assertThat(thirdPartyService.parseLocaleMapping("")).isEmpty(); assertThat(thirdPartyService.parseLocaleMapping("es:es-MX")).containsKey("es-MX").containsValue("es"); assertThat(thirdPartyService.parseLocaleMapping("es:es-MX,fr:fr-FR")) .containsKeys("es-MX", "fr-FR").containsValues("es", "fr"); assertThatThrownBy(() -> thirdPartyService.parseLocaleMapping("unparseable")) .isInstanceOf(IllegalArgumentException.class); }