@Test
public void testRead() throws
                       Exception {

    // given a JSON string
    @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();
    // when read this JSON string
    final StringReader reader = new StringReader(jsonString);
    final Pager pager = pagerJsonReader.read(reader);
    // then
    assertNotNull(pager);
    assertEquals(1234L,
                 pager.getId());
    assertEquals(5,
                 pager.getSize());
    assertEquals(3,
                 pager.getPosition());
    assertEquals(4,
                 pager.getHistory()
                      .size());
    assertEquals(Integer.valueOf(2),
                 pager.getHistory()
                      .pollLast());
    assertEquals(Integer.valueOf(3),
                 pager.getHistory()
                      .pollLast());
    assertEquals(Integer.valueOf(4),
                 pager.getHistory()
                      .pollLast());
    assertEquals(Integer.valueOf(1),
                 pager.getHistory()
                      .pollLast());
}