class OwnerCheck implements CheckDecorator {

    @Override
    public RecordCheck<PropertyRecord, PropertyConsistencyReport> decoratePropertyChecker(
            final RecordCheck<PropertyRecord, PropertyConsistencyReport> checker )
    {
        if ( owners == null && dynamics == null )
        {
            return checker;
        }
        return ( record, engine, records ) ->
        {
            if ( record.inUse() )
            {
                if ( owners != null && Record.NO_PREVIOUS_PROPERTY.is( record.getPrevProp() ) )
                { // this record is first in a chain
                    PropertyOwner.UnknownOwner owner = new PropertyOwner.UnknownOwner();
                    engine.comparativeCheck( owner, ORPHAN_CHECKER );
                    if ( null == owners.putIfAbsent( record.getId(), owner ) )
                    {
                        owner.markInCustody();
                    }
                }
                if ( dynamics != null )
                {
                    for ( PropertyBlock block : record )
                    {
                        RecordType type = recordType( block.forceGetType() );
                        if ( type != null )
                        {
                            ConcurrentMap<Long, DynamicOwner> dynamicOwners = dynamics.get( type );
                            if ( dynamicOwners != null )
                            {
                                long id = block.getSingleValueLong();
                                DynamicOwner.Property owner = new DynamicOwner.Property( type, record );
                                DynamicOwner prev = dynamicOwners.put( id, owner );
                                if ( prev != null )
                                {
                                    engine.comparativeCheck( prev.record( records ), owner );
                                }
                            }
                        }
                    }
                }
            }
            checker.check( record, engine, records );
        };
    }

      OwnerCheck( boolean active, DynamicStore... stores );

}