TranslationCardsISO { public static String getLanguageDisplayName(String isoCode, String sourceLanguageName) { String languageDisplayName = INVALID_LANGUAGE_NAME; if (languageMap.containsKey(isoCode)) { List<String> sourceLanguagesForIsoCode = languageMap.get(isoCode); String fallbackDisplayName = sourceLanguagesForIsoCode.get(0); String titleCaseSourceLanguage = getTitleCaseName(sourceLanguageName); languageDisplayName = sourceLanguagesForIsoCode.contains(titleCaseSourceLanguage) ? titleCaseSourceLanguage : fallbackDisplayName; } return languageDisplayName; }  static String getISOCodeForLanguage(String language); static String getLanguageDisplayName(String isoCode, String sourceLanguageName); @NonNull static String getTitleCaseName(String name); static final String INVALID_LANGUAGE_NAME; }
@Test public void shouldFetchFarsiLanguageNameForFarsiISOCode() { assertEquals("Farsi", TranslationCardsISO.getLanguageDisplayName("fa", "")); }
@Test public void shouldFetchPersianLanguageNameForFAIsoCodeAndPersianLanguageSpecifier() { assertEquals("Persian", TranslationCardsISO.getLanguageDisplayName("fa", "persian")); }