EasyMock.expect(mockDbCursor.next()).andReturn(secondCommit).once();
EasyMock.expect(mockDbCursor.hasNext()).andReturn(false).once();
EasyMock.replay(mockDbCursor);
DBCollection mockCommitCollection = EasyMock.createMock(DBCollection.class);
EasyMock.expect(mockCommitCollection.find(EasyMock.anyObject(DBObject.class))).andReturn(mockDbCursor);
EasyMock.replay(mockCommitCollection);
MongoConnection mockConnection = EasyMock.createMock(MongoConnection.class);
EasyMock.expect(mockConnection.getNodeCollection()).andReturn(mockNodeCollection).times(2);
EasyMock.expect(mockConnection.getCommitCollection()).andReturn(mockCommitCollection);