### Question:
JSONUtils { public static Map<String, Object> mapFromJSON(String json) { try { return mapper.readValue(json, Map.class); } catch (IOException ex) { throw new RuntimeException(ex); } }  static String beanToJSON(Object bean); static Object beanFromJSON(String json, Class<T> cls); static String mapToJSON(Map<String, Object> map); static Map<String, Object> mapFromJSON(String json);  }### Answer:
@Test public void testMapFromJSON() throws Exception { Map map = JSONUtils.mapFromJSON(json); assertNotNull(map); assertEquals(6, map.size()); assertEquals("John", map.get("firstName")); assertEquals("Smith", map.get("lastName")); assertEquals(25, map.get("age")); assertTrue(map.get("address") instanceof Map); assertTrue(map.get("phoneNumber") instanceof List); assertEquals(2, ((List) map.get("phoneNumber")).size()); assertTrue(map.get("gender") instanceof Map); assertEquals("male", ((Map) map.get("gender")).get("type")); }