@Override
  public PrefsRoot getPrefsRoot() {
    final PrefsRoot root = new PrefsRoot(1);

    for (String locale : mLocaleToStore) {
      final PrefItem localeChild = root.createChild().addValue("locale", locale);

      NextWordsStorage storage = new NextWordsStorage(mContext, locale);
      for (NextWordsContainer nextWordsContainer : storage.loadStoredNextWords()) {
        final PrefItem word =
            localeChild.createChild().addValue("word", nextWordsContainer.word.toString());

        for (NextWord nextWord : nextWordsContainer.getNextWordSuggestions()) {
          word.createChild()
              .addValue("nextWord", nextWord.nextWord)
              .addValue("usedCount", Integer.toString(nextWord.getUsedCount()));
        }
      }
    }

    return root;
  }
@Test
  public void testEmptyLoad() {
    final NextWordPrefsProvider underTest =
        new NextWordPrefsProvider(getApplicationContext(), asList("en", "fr"));

    final PrefsRoot emptyRoot = underTest.getPrefsRoot();

    Assert.assertEquals(1, emptyRoot.getVersion());
    Assert.assertEquals(0, TestUtils.convertToList(emptyRoot.getValues()).size());
    Assert.assertEquals(2, TestUtils.convertToList(emptyRoot.getChildren()).size());

    final PrefItem emptyEn = TestUtils.convertToList(emptyRoot.getChildren()).get(0);
    final PrefItem emptyFr = TestUtils.convertToList(emptyRoot.getChildren()).get(1);

    Assert.assertEquals("en", emptyEn.getValue("locale"));
    Assert.assertEquals(0, TestUtils.convertToList(emptyEn.getChildren()).size());
    Assert.assertEquals("fr", emptyFr.getValue("locale"));
    Assert.assertEquals(0, TestUtils.convertToList(emptyFr.getChildren()).size());
  }