RawJsonParser { public Map<String, Object> parseRawJson(Reader reader){ GsonBuilder gsonBuilder = new GsonBuilder(); Converters.registerDateTime(gsonBuilder); Converters.registerDuration(gsonBuilder); gsonBuilder.registerTypeAdapter(Period.class, new JodaPeriodAdapter()); Gson gson = gsonBuilder.create(); return gson.fromJson(reader, Map.class); }  Map<String, Object> parseRawJson(Reader reader); static Map<String, Object> serialize(Map<String, Object> itemStructureRawMap); static Object translate(Object item); static String fieldSnakeToCamel(String snakeString); static String snakeToCamel(String snakeString); static String dbEncode(Reader reader); static String dbEncode(Map<String, Object> map);  }
@Test public void testParseRawJson() throws Exception { final InputStreamReader inputStreamReader = new InputStreamReader( getClass().getClassLoader().getResourceAsStream("ehr_status_raw.json")); String serialized = RawJsonParser.dbEncode(inputStreamReader); Assert.assertNotNull(serialized); System.out.println(serialized); GsonBuilder gsonBuilder = EncodeUtil.getGsonBuilderInstance(); Gson gson = gsonBuilder.setPrettyPrinting().create(); Map<String, Object> retmap = gson.fromJson(serialized, TreeMap.class); Map<String, String> flatten = new EcisFlattener().generateEcisFlat(retmap); Assert.assertNotNull(flatten); System.out.println(gson.toJson(flatten, TreeMap.class)); }