presto-main/src/main/java/io/prestosql/sql/planner/plan/ChildReplacer.java/ChildReplacer/replaceChildren
class ChildReplacer:    public static PlanNode replaceChildren(PlanNode node, List<PlanNode> children)
    {
        for (int i = 0; i < node.getSources().size(); i++) {
            if (children.get(i) != node.getSources().get(i)) {
                return node.replaceChildren(children);
            }
        }
        return node;
    }