GsonUtils { public static <T> T fromJson(String json, Class<T> classOfT) { return gson.fromJson(json, classOfT); }  static T fromJson(String json, Class<T> classOfT); static T fromJson(String json, Type typeOfT); static T fromJson(JsonElement jsonElement, Class<T> classOfT); static T fromJson(JsonElement jsonElement, Type typeOfT); static String toJson(Object o); static String toPrettyPrintJson(Object o); Boolean isValidJson(String str); static JsonElement parseJson(String json);  }
@Test public void fromJson() { Date date = new Date(); Date d1 = GsonUtils.fromJson(GsonUtils.toJson(date), new TypeToken<Date>(){}.getType()); Date d2 = GsonUtils.fromJson(GsonUtils.toJson(date), new TypeToken<java.sql.Date>(){}.getType()); date = new java.sql.Date(System.currentTimeMillis()); d1 = GsonUtils.fromJson(GsonUtils.toJson(date), new TypeToken<Date>(){}.getType()); d2 = GsonUtils.fromJson(GsonUtils.toJson(date), new TypeToken<java.sql.Date>(){}.getType()); java.sql.Date sDate = new java.sql.Date(System.currentTimeMillis()); java.sql.Date d3 = GsonUtils.fromJson(GsonUtils.toJson(date), new TypeToken<java.sql.Date>(){}.getType()); }