JsonUtil { public static Map jsonToMap(String str) throws IOException { if (str != null) { JsonParser jsonParser = jsonFactory.createParser(str); jsonParser.enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES); jsonParser.enable(JsonParser.Feature.ALLOW_COMMENTS); return mapper.readValue(jsonParser, HashMap.class); } return null; }  static ObjectMapper getObjectMapper(); static JsonNode readTree(String str); static JsonNode readTree(File src); static T readValue(File src, Class<T> valueType); static T readValue(URL src, Class<T> valueType); static T readValue(Reader src, Class<T> valueType); static T readValue(JsonNode node, Class<T> valueType); static T readValue(String src, Class<T> valueType); static T readValue(InputStream src, Class<T> valueType); static T convertValue(Object fromValue, Class<T> valueType); static String writeValueAsString(Object obj); static Map jsonToMap(String str); static Parameters jsonToParameters(String str);  }
@Test public void jsonToMap() throws Exception { Map map = JsonUtil.jsonToMap("{}"); assertEquals(map.size(), 0); }