collection.save(element);
}
final AggregateMapper aggregateMapper = mock(AggregateMapper.class);
when(aggregateMapper.collectionName()).thenReturn("collection");
when(aggregateMapper.toInstance(Matchers.<DBObject>any())).thenReturn(new FakeAggregate("gfg"));
return new QueryExecutor<FakeAggregate>(db, aggregateMapper, new UnitOfWork(mock(MongoSessionImpl.class)));
}