### Question:
TypeUtil { public static Map<String, Object> toMap(JsonObject json) { Gson gson = new Gson(); return gson.fromJson(json, Map.class); } private  TypeUtil(); static Map<T, T> arrayToMap(T[] list); static Map<String, Object> toMap(JsonObject json); @SuppressWarnings({ "unchecked", "PMD.CollapsibleIfStatements" }) static Class<T> getType(final Object object); static T toObjectType(String data, Class<T> klass); static String toString(final Object obj, final Class<?> klass); static String toString(final Object obj, final Class<?> klass, String methodName); static String toString(final Object obj); static ValueMap toValueMap(final Map<String, ?> map);  }### Answer:
@Test public void testToMap() { final JsonObject json = new JsonObject(); json.addProperty("one", "uno"); json.addProperty("two", 2); json.addProperty("three", Long.valueOf(3)); final Map<String, Object> expResult = new HashMap<String, Object>(); expResult.put("one", "uno"); expResult.put("two", 2.0); expResult.put("three", 3.0); final Map<String, Object> actual = TypeUtil.toMap(json); assertEquals(expResult, actual); }