### Question:
NodeSchemaMatcher { static <SUPPLIER extends SchemaDescriptorSupplier, EXCEPTION extends Exception> void onMatchingSchema( Iterator<SUPPLIER> schemaSuppliers, int specialPropertyId, int[] existingPropertyIds, ThrowingConsumer<SUPPLIER,EXCEPTION> callback ) throws EXCEPTION { assert isSortedSet( existingPropertyIds ); while ( schemaSuppliers.hasNext() ) { SUPPLIER schemaSupplier = schemaSuppliers.next(); SchemaDescriptor schema = schemaSupplier.schema(); if ( nodeHasSchemaProperties( existingPropertyIds, schema.getPropertyIds(), specialPropertyId ) ) { callback.accept( schemaSupplier ); } } } private  NodeSchemaMatcher();   }### Answer:
@Test public void shouldNotMatchIfNodeIsMissingProperty() { List<IndexDescriptor> matched = new ArrayList<>(); NodeSchemaMatcher.onMatchingSchema( iterator( indexWithMissingProperty ), unIndexedPropId, props, matched::add ); assertThat( matched, empty() ); }
@Test public void shouldNotMatchIfNodeIsMissingLabel() { List<IndexDescriptor> matched = new ArrayList<>(); NodeSchemaMatcher.onMatchingSchema( iterator( indexWithMissingLabel ), node.labels().all(), unIndexedPropId, props, matched::add ); assertThat( matched, empty() ); }
@Test public void shouldMatchSeveralTimes() { List<IndexDescriptor> indexes = Arrays.asList( index1, index1, index1_2, index1_2 ); final List<IndexDescriptor> matched = new ArrayList<>(); NodeSchemaMatcher.onMatchingSchema( indexes.iterator(), unIndexedPropId, props, matched::add ); assertThat( matched, equalTo( indexes ) ); }