presto-main/src/main/java/io/prestosql/sql/planner/SubPlan.java/SubPlan/getAllFragments
class SubPlan:    public List<PlanFragment> getAllFragments()
    {
        ImmutableList.Builder<PlanFragment> fragments = ImmutableList.builder();

        fragments.add(getFragment());
        for (SubPlan child : getChildren()) {
            fragments.addAll(child.getAllFragments());
        }

        return fragments.build();
    }