static boolean hasLanguagePackForCurrentLocale(
      @NonNull List<KeyboardAddOnAndBuilder> availableLanguagePacks) {
    for (KeyboardAddOnAndBuilder availableLanguagePack : availableLanguagePacks) {
      final String language = availableLanguagePack.getKeyboardLocale();
      if (TextUtils.isEmpty(language)) continue;

      if (Locale.getDefault().getLanguage().equals(new Locale(language).getLanguage())) {
        return true;
      }
    }

    return false;
  }
@Test
  public void testHasLanguagePackForCurrentLocale() {
    final KeyboardFactory spiedKeyboardFactory = mApplication.getSpiedKeyboardFactory();
    ArrayList<KeyboardAddOnAndBuilder> mockResponse =
        new ArrayList<>(spiedKeyboardFactory.getAllAddOns());

    Assert.assertTrue(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));

    Locale.setDefault(Locale.FRENCH);
    Assert.assertFalse(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));

    KeyboardAddOnAndBuilder frenchBuilder = Mockito.mock(KeyboardAddOnAndBuilder.class);
    Mockito.doReturn("fr").when(frenchBuilder).getKeyboardLocale();
    mockResponse.add(frenchBuilder);

    Assert.assertTrue(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));

    Locale.setDefault(new Locale("he"));
    Assert.assertFalse(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));

    KeyboardAddOnAndBuilder hebrewBuilder = Mockito.mock(KeyboardAddOnAndBuilder.class);
    Mockito.doReturn("iw").when(hebrewBuilder).getKeyboardLocale();
    mockResponse.add(hebrewBuilder);

    Locale.setDefault(new Locale("iw"));
    Assert.assertTrue(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));

    Locale.setDefault(new Locale("ru"));
    Assert.assertFalse(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));

    Mockito.doReturn("ru").when(hebrewBuilder).getKeyboardLocale();
    Assert.assertTrue(SetupSupport.hasLanguagePackForCurrentLocale(mockResponse));
  }