@Test public void testComplexKeys() { Map<String, Object> root = new HashMap<>(); Map<String, Object> nested = new HashMap<>(); root.put("nested", nested); nested.put("key", "nestedValue"); nested.put("complex.key", 42); Map<String, Object> result = MapListTreeFlattener.flatten(root); assertThat(result).hasSize(2); assertThat(result).containsEntry("nested.key", "nestedValue"); assertThat(result).containsEntry("nested.complex.key", 42); }
public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; } }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }  }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }  static Map<String, Object> flatten(Object root); }
MapListTreeFlattener { public static Map<String, Object> flatten(Object root) { Map<String, Object> results = new HashMap<>(); flatten("", root, results); return results; }  static Map<String, Object> flatten(Object root);  }