### Question:
CompositeDBCursor implements DBCursor<UpdateMsg> { @Override public boolean next() throws ChangelogException { if (state == CLOSED) { return false; } final Entry<DBCursor<UpdateMsg>, T> cursorToAdvance = state != UNINITIALIZED ? cursors.pollFirstEntry() : null; state = READY; recycleExhaustedCursors(); if (cursorToAdvance != null) { addCursor(cursorToAdvance.getKey(), cursorToAdvance.getValue()); } incorporateNewCursors(); return !cursors.isEmpty(); }  @Override boolean next(); @Override UpdateMsg getRecord(); T getData(); @Override void close(); @Override String toString();  }### Answer:
@Test public void recycleTwoElementsCursor() throws Exception { final CompositeDBCursor<String> compCursor = newCompositeDBCursor( of(new SequentialDBCursor(msg1, null, msg2), baseDN1)); assertNextRecord(compCursor, of(msg1, baseDN1)); assertFalse(compCursor.next()); assertNextRecord(compCursor, of(msg2, baseDN1)); }