public void store(@NonNull String name, @NonNull String value) {
    if (mIncognitoMode) return;

    final HistoryKey usedKey = new HistoryKey(name, value);
    mLoadedKeys.remove(usedKey);
    mLoadedKeys.add(usedKey);

    while (mLoadedKeys.size() > MAX_LIST_SIZE) mLoadedKeys.remove(0 /*dropping the first key*/);

    final String encodedHistory = encodeForOldDevices(mLoadedKeys);

    mRxPref.set(encodedHistory);
  }
@Test
  public void testStore() {
    mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences);
    mUnderTest.store("1", "2");
    mUnderTest.store("3", "4");
    mUnderTest.store("5", "6");

    final List<QuickKeyHistoryRecords.HistoryKey> currentHistory = mUnderTest.getCurrentHistory();
    Assert.assertEquals(3 + 1 /*first default emoji*/, currentHistory.size());

    Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).name);
    Assert.assertEquals(QuickKeyHistoryRecords.DEFAULT_EMOJI, currentHistory.get(0).value);
    Assert.assertEquals("1", currentHistory.get(1).name);
    Assert.assertEquals("2", currentHistory.get(1).value);
    Assert.assertEquals("3", currentHistory.get(2).name);
    Assert.assertEquals("4", currentHistory.get(2).value);
    Assert.assertEquals("5", currentHistory.get(3).name);
    Assert.assertEquals("6", currentHistory.get(3).value);
  }