JsonFlattenConverter { public void flatten(String json, Properties props) { JsonNode jsonNode; try { jsonNode = new ObjectMapper().configure(JsonParser.Feature.ALLOW_COMMENTS, true).readTree(json); addKeys("", jsonNode, props); } catch (IOException e) { String errMsg = "Invalid json format\n"+json; if(ignoreInvalidJson) { logger.error(errMsg); } else { throw new RuntimeException(errMsg, e); } } }  void flatten(String json, Properties props); void setAllowOverride(boolean isAllowOverride); void setIgnoreInvalidJson(boolean ignoreInvalidJson);  }
@Test public void testCreatingKeyValues() { Properties properties = new Properties(); new JsonFlattenConverter().flatten(testJson, properties); properties.list(System.out); assert properties.size()==10; }