mockNodeCollection.group(EasyMock.anyObject(DBObject.class), EasyMock.anyObject(DBObject.class),
EasyMock.anyObject(DBObject.class), EasyMock.anyObject(String.class))).andReturn(results2)
.once();
EasyMock.replay(mockNodeCollection);
CommitMongo firstCommit = new CommitMongo();
firstCommit.setAffectedPaths(Arrays.asList(new String[] { "/", "/a", "/a/b", "/a/c" }));
firstCommit.setRevisionId(1L);
CommitMongo secondCommit = new CommitMongo();
secondCommit.setAffectedPaths(Arrays.asList(new String[] { "/a", "/a/d", "/a/b/e" }));
secondCommit.setRevisionId(2L);
DBCursor mockDbCursor = EasyMock.createMock(DBCursor.class);
EasyMock.expect(mockDbCursor.sort(EasyMock.anyObject(DBObject.class))).andReturn(mockDbCursor);
EasyMock.expect(mockDbCursor.limit(EasyMock.anyInt())).andReturn(mockDbCursor);
EasyMock.expect(mockDbCursor.hasNext()).andReturn(true).once();