JSONUtils { public static <T> T parseObject(String text, Class<T> clazz) { return JSON.parseObject(text, clazz); }  static String toJSONString(Object object); static T parseObject(String text, Class<T> clazz);  }
@Test public void parseObject() throws Exception { Assert.assertTrue(JSONUtils.parseObject("\"true\"", boolean.class)); Assert.assertEquals("s", JSONUtils.parseObject("\"s\"", String.class)); Assert.assertEquals((Integer) 1, JSONUtils.parseObject("\"1\"", Integer.class)); Assert.assertEquals(new HashMap(), JSONUtils.parseObject("{}", Map.class)); Assert.assertEquals(new ArrayList(), JSONUtils.parseObject("[]", List.class)); Assert.assertEquals(new Object[0], JSONUtils.parseObject("[]", Object[].class)); }