@SuppressLint("CommitPrefEdits")
@Test
public void testDelete() throws
                         Exception {

    // given an existing pager
    @SuppressWarnings("StringBufferReplaceableByString")
    final String jsonString = new StringBuilder().append('{')
                                                 .append("\"id\":")
                                                 .append(1234L)
                                                 .append(",\"size\":")
                                                 .append(5)
                                                 .append(",\"position\":")
                                                 .append(3)
                                                 .append(",\"history\":[1,4,3,2]")
                                                 .append('}')
                                                 .toString();
    PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application)
                     .edit()
                     .putString(pagerHelper.getPagerPreferenceKey(1234L),
                                jsonString)
                     .commit();
    // when trying to delete this pager
    pagerHelper.delete(1234L);
    // then
    final Pager pagerLoader = pagerHelper.load(1234L);
    assertEquals(0,
                 pagerLoader.getSize());
    assertEquals(0,
                 pagerLoader.getPosition());
    assertTrue(pagerLoader.getHistory()
                          .isEmpty());
    assertNull(PreferenceManager.getDefaultSharedPreferences(RuntimeEnvironment.application)
                                .getString(pagerHelper.getPagerPreferenceKey(1234L),
                                           null));
}