@Test(expected = RuntimeException.class) public void testToJSONStringError() { JSONUtil.toJSONString(System.out); }
public static <T> String toJSONString(T object) { String jsonStr; try { jsonStr = mapper.writeValueAsString(object); } catch (Exception e) { LOGGER.error("Java Object Can't covert to JSON String!"); throw new RuntimeException(e); } return jsonStr; }
JSONUtil { public static <T> String toJSONString(T object) { String jsonStr; try { jsonStr = mapper.writeValueAsString(object); } catch (Exception e) { LOGGER.error("Java Object Can't covert to JSON String!"); throw new RuntimeException(e); } return jsonStr; } }
JSONUtil { public static <T> String toJSONString(T object) { String jsonStr; try { jsonStr = mapper.writeValueAsString(object); } catch (Exception e) { LOGGER.error("Java Object Can't covert to JSON String!"); throw new RuntimeException(e); } return jsonStr; }  }
JSONUtil { public static <T> String toJSONString(T object) { String jsonStr; try { jsonStr = mapper.writeValueAsString(object); } catch (Exception e) { LOGGER.error("Java Object Can't covert to JSON String!"); throw new RuntimeException(e); } return jsonStr; }  static String toJSONString(T object); static T toObject(String json, Class<T> clazz); }
JSONUtil { public static <T> String toJSONString(T object) { String jsonStr; try { jsonStr = mapper.writeValueAsString(object); } catch (Exception e) { LOGGER.error("Java Object Can't covert to JSON String!"); throw new RuntimeException(e); } return jsonStr; }  static String toJSONString(T object); static T toObject(String json, Class<T> clazz);  }