@NonNull public List<DictionaryAddOnAndBuilder> getBuildersForKeyboard(AnyKeyboard keyboard) {
    List<DictionaryAddOnAndBuilder> builders = new ArrayList<>();
    final String dictionaryValue =
        mSharedPreferences.getString(getDictionaryOverrideKey(keyboard), null);

    if (TextUtils.isEmpty(dictionaryValue)) {
      final DictionaryAddOnAndBuilder builderByLocale =
          AnyApplication.getExternalDictionaryFactory(mContext)
              .getDictionaryBuilderByLocale(keyboard.getDefaultDictionaryLocale());
      if (builderByLocale != null) builders.add(builderByLocale);
    } else {
      String[] ids = dictionaryValue.split(":", -1);
      for (String id : ids) {
        final DictionaryAddOnAndBuilder addOnById =
            AnyApplication.getExternalDictionaryFactory(mContext).getAddOnById(id);
        if (addOnById != null) builders.add(addOnById);
      }
    }

    return builders;
  }
@Test
  public void testEmptyBuildersForKeyboardIfUnknownLocale() {
    AnyKeyboard keyboard = Mockito.mock(AnyKeyboard.class);
    Mockito.doReturn("none").when(keyboard).getDefaultDictionaryLocale();
    Mockito.doReturn("some_id").when(keyboard).getKeyboardId();

    final List<DictionaryAddOnAndBuilder> buildersForKeyboard =
        mFactory.getBuildersForKeyboard(keyboard);
    Assert.assertNotNull(buildersForKeyboard);
    Assert.assertEquals(0, buildersForKeyboard.size());
  }