### Question:
SingletonIndexCursor extends AbstractIndexCursor<V> { @Override public boolean next() throws LdapException, CursorException { checkNotClosed(); if ( beforeFirst ) { beforeFirst = false; onSingleton = true; afterLast = false; return true; } if ( afterLast ) { return false; } beforeFirst = false; onSingleton = false; afterLast = true; return false; } SingletonIndexCursor( PartitionTxn partitionTxn, IndexEntry<V, String> singleton ); @Override boolean available(); @Override void beforeFirst(); @Override void afterLast(); @Override boolean first(); @Override boolean last(); @Override boolean isFirst(); @Override boolean isLast(); @Override boolean isAfterLast(); @Override boolean isBeforeFirst(); @Override boolean previous(); @Override boolean next(); IndexEntry<V, String> get(); @Override void close(); @Override void close( Exception cause );  }### Answer:
@Test public void testNext() throws Exception { assertTrue( indexCursor.next() ); assertFalse( indexCursor.next() ); indexCursor.beforeFirst(); assertTrue( indexCursor.next() ); assertFalse( indexCursor.next() ); indexCursor.first(); assertFalse( indexCursor.next() ); indexCursor.last(); assertFalse( indexCursor.next() ); indexCursor.afterLast(); assertFalse( indexCursor.next() ); }