private static Map<String, LeafNode<?>> getAllDescendantLeafNodes(String parentName, InnerNode node) {
         Map<String, LeafNode<?>> ret = new LinkedHashMap<>();
         String prefix = parentName.isEmpty() ? "" : parentName + ".";
         Map<String, Node> children = node.getChildrenWithVectorsFlattened();
         for (Map.Entry<String, Node> childEntry : children.entrySet()) {
             String name = childEntry.getKey();
             String prefixedName = prefix + name;
             name.replaceAll("\\[.*", "");
             Node child = childEntry.getValue();
             if (child instanceof LeafNode) {
                 ret.put(prefixedName, (LeafNode<?>) child);
             } else if (child instanceof InnerNode) {
                 ret.putAll(getAllDescendantLeafNodes(prefixedName, (InnerNode) child));
             }
         }
         return ret;
     }
Generates a map of all leaf nodes, with full.paths[3] in key

@param parentName Name of the parent node, can be empty.
@param node The node to get leaf nodes for.
@return map of leaf nodes
config-lib/src/main/java/com/yahoo/config/InnerNode.java