@Test
public void addIntToJsonMap() throws Exception {

    Map<String, Object> map = new LinkedHashMap<String, Object>();
    JsonLayout jsonLayout = new JsonLayout();
    jsonLayout.addInt("key1", true, 1, map);
    jsonLayout.addInt("key2", false, 1, map);
    jsonLayout.addInt("key3", true, -1, map);
    assertThat(map.size(), is(2));
    assertThat(map, hasKey("key1"));
    assertEquals(map.get("key1"), "1");
    assertThat(map, not(hasKey("key2")));
    assertThat(map, hasKey("key3"));
    assertEquals(map.get("key3"), "-1");
}