JSONUtils { public static String toJSONString(Object object) { return JSON.toJSONString(object); }  static String toJSONString(Object object); static T parseObject(String text, Class<T> clazz);  }
@Test public void toJSONString() throws Exception { Assert.assertEquals(JSONUtils.toJSONString("xxx"), "\"xxx\""); Assert.assertEquals(JSONUtils.toJSONString(1), "1"); Assert.assertEquals(JSONUtils.toJSONString(2.2d), "2.2"); Assert.assertEquals(JSONUtils.toJSONString(false), "false"); Assert.assertEquals(JSONUtils.toJSONString(new HashMap()), "{}"); Assert.assertEquals(JSONUtils.toJSONString(new ArrayList()), "[]"); Assert.assertEquals(JSONUtils.toJSONString(new Object[0]), "[]"); }