@Test
public void testWriteEmptyPager() throws
                                  Exception {

    // given an empty pager metadata
    final Pager pager = new Pager();
    // when write this pager as JSON string
    final StringWriter writer = new StringWriter();
    pagerJsonWriter.write(writer,
                          pager);
    // then
    assertNotNull(writer.toString());
    @SuppressWarnings("StringBufferReplaceableByString")
    final String expectedJsonString = new StringBuilder().append('{')
                                                         .append("\"id\":")
                                                         .append(0)
                                                         .append(",\"size\":")
                                                         .append(0)
                                                         .append(",\"position\":")
                                                         .append(0)
                                                         .append(",\"history\":[]")
                                                         .append('}')
                                                         .toString();
    assertEquals(expectedJsonString,
                 writer.toString());
}