{
Index<Node> index = nodeIndex( "numeric2", LuceneIndexImplementation.EXACT_CONFIG );
Node node1 = graphDb.createNode();
Node node2 = graphDb.createNode();
String key = "key";
index.add( node1, key, new ValueContext( 15 ).indexNumeric() );
index.add( node2, key, new ValueContext( 5 ).indexNumeric() );
index.remove( node1, key, new ValueContext( 15 ).indexNumeric() );
assertThat( index.query( NumericRangeQuery.newIntRange( key, 0, 20, false, false ) ), contains( node2 ) );
index.remove( node2, key, new ValueContext( 5 ).indexNumeric() );
assertThat( index.query( NumericRangeQuery.newIntRange( key, 0, 20, false, false ) ), isEmpty() );
restartTx();
assertThat( index.query( NumericRangeQuery.newIntRange( key, 0, 20, false, false ) ), isEmpty() );
index.add( node1, key, new ValueContext( 15 ).indexNumeric() );
index.add( node2, key, new ValueContext( 5 ).indexNumeric() );
restartTx();
assertThat( index.query( NumericRangeQuery.newIntRange( key, 0, 20, false, false ) ), contains( node1, node2 ) );
index.remove( node1, key, new ValueContext( 15 ).indexNumeric() );
assertThat( index.query( NumericRangeQuery.newIntRange( key, 0, 20, false, false ) ), contains( node2 ) );
restartTx();
assertThat( index.query( NumericRangeQuery.newIntRange( key, 0, 20, false, false ) ), contains( node2 ) );