@Override
    public List<V> transform(FetchableQuery<?,?> query) {
        // create groups
        FactoryExpression<Tuple> expr = FactoryExpressionUtils.wrap(Projections.tuple(expressions));
        boolean hasGroups = false;
        for (Expression<?> e : expr.getArgs()) {
            hasGroups |= e instanceof GroupExpression;
        }
        if (hasGroups) {
            expr = withoutGroupExpressions(expr);
        }
        final CloseableIterator<Tuple> iter = query.select(expr).iterate();

        List<V> list = new ArrayList<>();
        GroupImpl group = null;
        K groupId = null;
        while (iter.hasNext()) {
            @SuppressWarnings("unchecked") //This type is mandated by the key type
            K[] row = (K[]) iter.next().toArray();
            if (group == null) {
                group = new GroupImpl(groupExpressions, maps);
                groupId = row[0];
            } else if (!Objects.equals(groupId, row[0])) {
                list.add(transform(group));
                group = new GroupImpl(groupExpressions, maps);
                groupId = row[0];
            }
            group.add(row);
        }
        if (group != null) {
            list.add(transform(group));
        }
        iter.close();
        return list;
    }
Provides aggregated results as a list

@author tiwe

@param <K>
@param <V>
querydsl-core/src/main/java/com/querydsl/core/group/GroupByList.java