question: public void test_delete_markers_doNotVisitDeleted ( ) { final BTree btree ; { IndexMetadata md = new IndexMetadata ( UUID . randomUUID ( ) ) ; md . setDeleteMarkers ( true ) ; btree = BTree . create ( new SimpleMemoryRawStore ( ) , md ) ; btree . insert ( 10 , "Bryan" ) ; btree . insert ( 20 , "Mike" ) ; btree . insert ( 30 , "James" ) ; } final int flags = IRangeQuery . DEFAULT ; { ITupleCursor2 < String > cursor = newCursor ( btree , flags , null , null ) ; assertEquals ( new TestTuple < String > ( flags , 10 , "Bryan" , false , 0L ) , cursor . seek ( 10 ) ) ; cursor . remove ( ) ; assertEquals ( null , cursor . tuple ( ) ) ; assertTrue ( cursor . hasNext ( ) ) ; assertEquals ( new TestTuple < String > ( flags , 20 , "Mike" , false , 0L ) , cursor . next ( ) ) ; assertFalse ( cursor . hasPrior ( ) ) ; try { cursor . prior ( ) ; fail ( "Expecting " + NoSuchElementException . class ) ; } catch ( NoSuchElementException ex ) { log . info ( "Ignoring expected exception: " + ex ) ; } } }
target:  Test examines the behavior of the cursor when delete markers are enabled and the cursor is NOT willing to visited deleted tuples. Since delete markers are enabled remove() will actually be an update that sets the delete marker on the tuple and clears the value associated with that tuple. Since deleted tuples are NOT being visited by the cursor, the caller deleted tuples will appear to "disappear" just like they do when a tuple is remove()'d from an index that does not support delete markers.