### Question:
MapUtil { public static <T> T jsonStrToObject(String jsonStr, Class<T> clazz) throws JsonParseException, JsonMappingException, JsonGenerationException, IOException { return objectMapper.readValue(jsonStr, clazz); }  static Map<String, Object> convertToHashMap(Map<String, Object> target); static Map<String,Object> objectToMap(Object obj); static T jsonStrToObject(String jsonStr, Class<T> clazz);  }### Answer:
@Test public void testJsonStrToObject() { try { Map<String, Object> result = MapUtil.jsonStrToObject("{\"key\":\"val\"}", Map.class); Assert.assertEquals(result, new HashMap<String, Object>() {{ put("key", "val"); }}); } catch (Exception e) { throw new RuntimeException(e); } }