public void test_concurrent_modification_update(){
  final BTree btree;
{
    btree=BTree.create(new SimpleMemoryRawStore(),new IndexMetadata(UUID.randomUUID()));
    btree.insert(10,"Bryan");
    btree.insert(20,"Mike");
    btree.insert(30,"James");
  }
{
    ITupleCursor2<String> cursor=newCursor(btree);
    assertEquals(new TestTuple<String>(20,"Mike"),cursor.seek(20));
    assertEquals(new TestTuple<String>(20,"Mike"),cursor.tuple());
    btree.insert(20,"Michael");
    assertEquals(new TestTuple<String>(20,"Michael"),cursor.tuple());
  }
}

public void test_concurrent_modification_update ( ) { final BTree btree ; { btree = BTree . create ( new SimpleMemoryRawStore ( ) , new IndexMetadata ( UUID . randomUUID ( ) ) ) ; btree . insert ( 10 , "Bryan" ) ; btree . insert ( 20 , "Mike" ) ; btree . insert ( 30 , "James" ) ; } { ITupleCursor2 < String > cursor = newCursor ( btree ) ; assertEquals ( new TestTuple < String > ( 20 , "Mike" ) , cursor . seek ( 20 ) ) ; assertEquals ( new TestTuple < String > ( 20 , "Mike" ) , cursor . tuple ( ) ) ; btree . insert ( 20 , "Michael" ) ; assertEquals ( new TestTuple < String > ( 20 , "Michael" ) , cursor . tuple ( ) ) ; } }
test for update ( the tuple state must be re - copied from the index ) . < p > note that copy - on - write is handled differently even when the trigger is an update ( vs an insert or a remove ) .
