class 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();

}