### Question:
JsonUtils { public static String cdrToJson(Cdr cdr) { return getGson().toJson(cdr); } private  JsonUtils(); static Gson getGson(); static Cdr jsonToCdr(String json); static String cdrToJson(Cdr cdr);  }### Answer:
@Test public void testCdrToJson() { String json = "{ test: { test2: \"value1\", test3: [ \"abc\", \"def\", \"ghi\" ], test4: 4.0, test5: 5 } }"; Cdr cdr = JsonUtils.jsonToCdr(json); String newJson = JsonUtils.cdrToJson(cdr); JsonParser parser = new JsonParser(); JsonElement originalJson = parser.parse(json); JsonElement reparsedJson = parser.parse(newJson); assertEquals(originalJson, reparsedJson); String jsonList = "[ 1.0, [ 1, 2 ], true, \"test\", { test2: \"\", test3: [ \"abc\", true, null ], test4: 4.0, test5: 5 } ]"; Cdr cdrList = JsonUtils.jsonToCdr(jsonList); String newJsonList = JsonUtils.cdrToJson(cdrList); originalJson = parser.parse(jsonList); reparsedJson = parser.parse(newJsonList); assertEquals(originalJson, reparsedJson); }