public CompileTreeNode findOrCreateNode(List<Integer> path) {
            Iterator<Integer> pathIterator = path.iterator();

            int ri = pathIterator.next();
            CompileTreeNode node = ri < rootNodes.size() ? rootNodes.get(ri) : null;
            if (node == null) {
                node = new CompileTreeNode();
                rootNodes.add(ri, node);
                size++;
            }

            while (pathIterator.hasNext()) {
                int i = pathIterator.next();
                CompileTreeNode next = i < node.children.size() ? node.children.get(i) : null;
                if (next == null) {
                    next = new CompileTreeNode();
                    node.children.add(i, next);
                    size++;
                }
                node = next;
            }
            return node;
        }
Find the node at the given path, creating empty nodes when necessary
fabrication/src/main/java/mrtjp/projectred/fabrication/engine/log/ICCompilerLog.java