coll.insert(new MockObject("bar", 101));
coll.insert(new MockObject("bar", 102));
AggregationBuilder<MockObjectAggregationResult> builder = new AggregationBuilder<MockObjectAggregationResult>();
builder.group(new GroupAggregation("string").withSum("integer", "integer"))
.project(new ProjectAggregation().set("integer", "string"));
AggregationResult<MockObjectAggregationResult> aggregationResult = coll.aggregate(builder.build(MockObjectAggregationResult.class));
Assert.assertEquals(2, aggregationResult.results().size());
Assert.assertEquals("203", aggregationResult.results().get(0).string);