### Question:
MapUtils { public static Map<String, Object> flatMap(@NonNull Map<String, Object> map, String joinKey) { return recursiveFlat(map, joinKey, new ArrayList<>()); }  static List<Map<String, Object>> flatMaps(@NonNull List<Map<String, Object>> maps, String joinKey); static Map<String, Object> flatMap(@NonNull Map<String, Object> map, String joinKey); static List<Map<String, Object>> formatMaps(@NonNull List<Map<String, Object>> maps, String joinKey); static Map<String, Object> formatMap(@NonNull Map<String, Object> map, String joinKey);  }### Answer:
@Test public void flatMap() { String json = "{" + " \"1\":\"value 1\"," + " \"2\":{" + " \"2.1\":{" + " \"2.1.1\":\"value 2.1.1\"" + " }" + " }" + "}"; Map<String, Object> map = JSONObject.parseObject(json, new TypeReference<Map<String, Object>>() { }); Map<String, Object> flatMap = MapUtils.flatMap(map, ":"); Assert.assertEquals("{\"1\":\"value 1\",\"2:2.1:2.1.1\":\"value 2.1.1\"}", JSONObject.toJSONString(flatMap)); }