### Question:
JsonUtils { public static String toJson(Object source) { return getGson().toJson(source); } private  JsonUtils(); static String stripComment(String source); static String toJson(Object source); static Map<String, Object> toMap(String json); static Object[] toArray(String json); static Collection<T> toCollection(String json);  }### Answer:
@Test public void toJson_Object() { GsonPerson obj = new GsonPerson("name1", 1); Assert.assertEquals("{\"name\":\"name1\",\"age\":1}", JsonUtils.toJson(obj)); }
@Test public void toJson_String() { Assert.assertEquals("\"name\"", JsonUtils.toJson("name")); }