public <V, RES extends Collection<V>> ResultTransformer<RES> collection(Supplier<RES> resultFactory, FactoryExpression<V> expression) {
        final FactoryExpression<V> transformation = FactoryExpressionUtils.wrap(expression);
        List<Expression<?>> args = transformation.getArgs();
        return new GroupByGenericCollection<K, V, RES>(resultFactory, key, args.toArray(new Expression<?>[args.size()])) {
            @Override
            protected V transform(Group group) {
                // XXX Isn't group.toArray() suitable here?
                List<Object> args = new ArrayList<Object>(groupExpressions.size() - 1);
                for (int i = 1; i < groupExpressions.size(); i++) {
                    args.add(group.getGroup(groupExpressions.get(i)));
                }
                return transformation.newInstance(args.toArray());
            }
        };
    }
Get the results as a list

@param expression projection
@return new result transformer
querydsl-core/src/main/java/com/querydsl/core/group/GroupByBuilder.java