JacksonUtil { public static <T> T readValue(String jsonStr, Class<T> clazz) { try { return getInstance().readValue(jsonStr, clazz); } catch (JsonParseException e) { logger.error(e.getMessage(), e); } catch (JsonMappingException e) { logger.error(e.getMessage(), e); } catch (IOException e) { logger.error(e.getMessage(), e); } return null; }  static ObjectMapper getInstance(); static String writeValueAsString(Object obj); static T readValue(String jsonStr, Class<T> clazz); static T readValue(String jsonStr, Class<?> parametrized, Class<?>... parameterClasses);  }
@Test public void shouldReadValueAsObject() { String jsonString = "{\"aaa\":\"111\",\"bbb\":\"222\"}"; Map result = JacksonUtil.readValue(jsonString, Map.class); assertThat(result.get("aaa"), Is.<Object>is("111")); assertThat(result.get("bbb"), Is.<Object>is("222")); }