LocaleHelper { @NonNull public List<String> getLocalesWithTranslation(final Resources resources) { String[] languageList = BuildConfig.TRANSLATION_ARRAY; Set<String> availableLanguagesSet = new HashSet<>(); availableLanguagesSet.add("en"); String[] translatedLanguages = resources.getStringArray(R.array.available_languages); Set<String> translatedLanguageSet = new HashSet<>(); Collections.addAll(translatedLanguageSet, translatedLanguages); for (String language : languageList) { if (translatedLanguageSet.contains(language)) availableLanguagesSet.add(language); } List<String> availableLanguagesList = new ArrayList<>(availableLanguagesSet); Collections.sort(availableLanguagesList); return availableLanguagesList; }  String getDisplayLanguage(String language); void updateLanguage(@NonNull final Context context, @NonNull final String language); @NonNull List<String> getLocalesWithTranslation(final Resources resources); Locale getDeviceLocale();  }
@Test public void ShouldReturnAtLeastEnglish_WhenAsked() throws Exception { final Resources resources = RuntimeEnvironment.application.getResources(); final List<String> localesWithTranslation = helper.getLocalesWithTranslation(resources); assertThat(localesWithTranslation.size()).isGreaterThanOrEqualTo(1); assertThat(localesWithTranslation).contains("en"); }