public <V, RES extends Map<K, V>> ResultTransformer<RES> as(final Supplier<RES> mapFactory, Expression<V> expression) {
        final Expression<V> lookup = getLookup(expression);
        return new GroupByGenericMap<K, V, RES>(mapFactory, key, expression) {
            @Override
            protected RES transform(Map<K, Group> groups) {
                RES results = mapFactory.get();
                for (Map.Entry<K, Group> entry : groups.entrySet()) {
                    results.put(entry.getKey(), entry.getValue().getOne(lookup));
                }
                return results;
            }
        };
    }
Get the results as a map

@param mapFactory The map factory to use, i.e. {@code HashMap::new}.
@param expression projection
@return new result transformer
querydsl-core/src/main/java/com/querydsl/core/group/GroupByBuilder.java