### Question:
MapUtils { public static Map<String, Object> formatMap(@NonNull Map<String, Object> map, String joinKey) { Map<String, Object> result = new HashMap<>(); for (Map.Entry<String, Object> entry : map.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); String[] keyPath = key.split(joinKey); putIntoMapByPath(result, value, keyPath); } return result; }  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 formatMap() { 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> formatMap = MapUtils.formatMap(map, ":"); Assert.assertEquals("{\"1\":\"value 1\",\"2\":{\"2.1\":{\"2.1.1\":\"value 2.1.1\"}}}", JSONObject.toJSONString(formatMap)); }