code: public List<AggregationSelectItem> getAggregationSelectItems() {
          List<AggregationSelectItem> result = new LinkedList<>();
          for (SelectItem each : items) {
              if (each instanceof AggregationSelectItem) {
                  AggregationSelectItem aggregationSelectItem = (AggregationSelectItem) each;
                  result.add(aggregationSelectItem);
                  result.addAll(aggregationSelectItem.getDerivedAggregationSelectItems());
              }
          }
          return result;
      }
docs: Get aggregation select items.
  
  @return aggregation select items