@Test
public void testListFlattening() {

    Map<String, Object> root = new HashMap<>();
    root.put("l1", Arrays.asList("A", "B", "C"));
    root.put("l2", Arrays.asList(42));
    Map<String, Object> result = MapListTreeFlattener.flatten(root);
    assertThat(result).hasSize(4);
    assertThat(result).containsEntry("l1[0]", "A");
    assertThat(result).containsEntry("l1[1]", "B");
    assertThat(result).containsEntry("l1[2]", "C");
    assertThat(result).containsEntry("l2[0]", 42);
}