JsonHandler implements Serializable { public String format(Object obj) { String ret = serializer.serialize(obj); return ret; } JsonHandler(); static JsonHandler instance(); JSONDeserializer<Object> getDeserializer(); JSONSerializer getSerializer(); String format(Object obj); void format(Object obj, Writer writer); Object parse(String str); @SuppressWarnings("unchecked") T parse(String str, Class<T> clazz); void setPrettyPrint(boolean prettyPrint);  }
@Test public void testFormatBasics() { assertEquals("null", handler.format(null)); assertEquals("true", handler.format(true)); assertEquals("false", handler.format(false)); assertEquals("\"my string\"", handler.format("my string")); assertEquals("\"null\"", handler.format("null")); assertEquals("\"true\"", handler.format("true")); assertEquals("2", handler.format(2)); assertEquals("2.4", handler.format(2.4)); assertEquals("\"\"", handler.format("")); }