LanguageService { public String getLanguageDisplayName(String isoCode) { if (languageMap.containsKey(isoCode)) { return languageMap.get(isoCode).get(0); } return INVALID_LANGUAGE_NAME; } LanguageService(LanguagesImportUtility langImportUtility); String getLanguageDisplayName(String isoCode); String getIsoForLanguage(String label); List<String> getLanguageNames(); @NonNull static String getTitleCaseName(String name); static final String INVALID_ISO_CODE; static final String INVALID_LANGUAGE_NAME; }
@Test public void shouldReturnInvalidLanguageNameForNullIsoCode() throws Exception { assertEquals(LanguageService.INVALID_LANGUAGE_NAME, languageService.getLanguageDisplayName(null)); }