private void assertFoundNodesAndValue( NodeValueIndexCursor node, int nodes, MutableLongSet uniqueIds, IndexValueCapability expectValue, boolean indexProvidesValues ) { uniqueIds.clear(); for ( int i = 0; i < nodes; i++ ) { assertTrue( "at least " + nodes + " nodes, was " + uniqueIds.size(), node.next() ); long nodeReference = node.nodeReference(); assertTrue( "all nodes are unique", uniqueIds.add( nodeReference ) ); // Assert has value capability if ( IndexValueCapability.YES.equals( expectValue ) ) { assertTrue( "Value capability said index would have value for " + expectValue + ", but didn't", node.hasValue() ); } // Assert has correct value if ( indexProvidesValues ) { assertTrue( "Index did not provide values", node.hasValue() ); Value storedValue = getPropertyValueFromStore( nodeReference ); assertThat( "has correct value", node.propertyValue( 0 ), is( storedValue ) ); } } assertFalse( "no more than " + nodes + " nodes", node.next() ); }