private void combineChildrenNodes(ProfileStackNode targetNode, ProfileStackNode beingMergedNode,
        Consumer<Pair<ProfileStackNode, ProfileStackNode>> continueChildrenMerging) {
        if (beingMergedNode.children.isEmpty()) {
            return;
        }

        for (ProfileStackNode childrenNode : targetNode.children) {
            // find node from being merged node children
            for (ListIterator<ProfileStackNode> it = beingMergedNode.children.listIterator(); it.hasNext(); ) {
                ProfileStackNode node = it.next();
                if (node != null && node.matches(childrenNode)) {
                    childrenNode.combineDetectedStacks(node);
                    continueChildrenMerging.accept(new Pair<>(childrenNode, node));

                    it.set(null);
                    break;
                }
            }
        }

        for (ProfileStackNode node : beingMergedNode.children) {
            if (node != null) {
                targetNode.children.add(node);
            }
        }
    }
merge all children nodes to appoint node
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/profiling/trace/analyze/ProfileStackNode.java