class OwnerCheck implements CheckDecorator {

    RecordCheck<DynamicRecord, DynamicConsistencyReport> decorateDynamicChecker(
            final RecordType type, final RecordCheck<DynamicRecord, DynamicConsistencyReport> checker )
    {
        final ConcurrentMap<Long, DynamicOwner> dynamicOwners = dynamicOwners( type );
        if ( dynamicOwners == null )
        {
            return checker;
        }
        return ( record, engine, records ) ->
        {
            if ( record.inUse() )
            {
                DynamicOwner.Unknown owner = new DynamicOwner.Unknown();
                engine.comparativeCheck( owner, DynamicOwner.ORPHAN_CHECK );
                if ( null == dynamicOwners.putIfAbsent( record.getId(), owner ) )
                {
                    owner.markInCustody();
                }
                if ( !Record.NO_NEXT_BLOCK.is( record.getNextBlock() ) )
                {
                    DynamicOwner.Dynamic nextOwner = new DynamicOwner.Dynamic( type, record );
                    DynamicOwner prevOwner = dynamicOwners.put( record.getNextBlock(), nextOwner );
                    if ( prevOwner != null )
                    {
                        engine.comparativeCheck( prevOwner.record( records ), nextOwner );
                    }
                }
            }
            checker.check( record, engine, records );
        };
    }

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

}