@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);
}