@Test public void testWriteStringIntMap() throws Exception { final Map<String, Integer> map = new HashMap<String, Integer>() { { put("a", Integer.MAX_VALUE); put("b", Integer.MIN_VALUE); put("c", 3); } }; builder.writeMap(map); final JSONObject root = JSONObject.fromObject(writer.toString()); assertEquals(3, root.size()); assertEquals(Integer.MAX_VALUE, root.get("a")); assertEquals(Integer.MIN_VALUE, root.get("b")); assertEquals(3, root.get("c")); }