### Question:
OwnerCheck implements CheckDecorator { @Override public RecordCheck<PropertyKeyTokenRecord, PropertyKeyTokenConsistencyReport> decoratePropertyKeyTokenChecker( RecordCheck<PropertyKeyTokenRecord, PropertyKeyTokenConsistencyReport> checker ) { ConcurrentMap<Long, DynamicOwner> dynamicOwners = dynamicOwners( PROPERTY_KEY_NAME ); if ( dynamicOwners == null ) { return checker; } return new NameCheckerDecorator <PropertyKeyTokenRecord, PropertyKeyTokenConsistencyReport>( checker, dynamicOwners ) { @Override DynamicOwner.NameOwner owner( PropertyKeyTokenRecord record ) { return new DynamicOwner.PropertyKey( record ); } }; } OwnerCheck( boolean active, DynamicStore... stores ); @Override void prepare(); @Override OwningRecordCheck<NeoStoreRecord, NeoStoreConsistencyReport> decorateNeoStoreChecker(
            OwningRecordCheck<NeoStoreRecord, NeoStoreConsistencyReport> checker ); @Override OwningRecordCheck<NodeRecord, NodeConsistencyReport> decorateNodeChecker(
            OwningRecordCheck<NodeRecord, NodeConsistencyReport> checker ); @Override OwningRecordCheck<RelationshipRecord, RelationshipConsistencyReport> decorateRelationshipChecker(
            OwningRecordCheck<RelationshipRecord, RelationshipConsistencyReport> checker ); @Override RecordCheck<PropertyRecord, PropertyConsistencyReport> decoratePropertyChecker(
            final RecordCheck<PropertyRecord, PropertyConsistencyReport> checker ); @Override RecordCheck<PropertyKeyTokenRecord, PropertyKeyTokenConsistencyReport> decoratePropertyKeyTokenChecker(
            RecordCheck<PropertyKeyTokenRecord, PropertyKeyTokenConsistencyReport> checker ); @Override RecordCheck<RelationshipTypeTokenRecord,RelationshipTypeConsistencyReport> decorateRelationshipTypeTokenChecker(
            RecordCheck<RelationshipTypeTokenRecord,RelationshipTypeConsistencyReport> checker ); @Override RecordCheck<LabelTokenRecord, LabelTokenConsistencyReport> decorateLabelTokenChecker(
            RecordCheck<LabelTokenRecord, LabelTokenConsistencyReport> checker ); @Override RecordCheck<RelationshipGroupRecord, RelationshipGroupConsistencyReport> decorateRelationshipGroupChecker(
            RecordCheck<RelationshipGroupRecord, RelationshipGroupConsistencyReport> checker );  }### Answer:
@Test void shouldReportDynamicRecordOwnedByTwoPropertyKeys() { RecordAccessStub records = new RecordAccessStub(); OwnerCheck decorator = new OwnerCheck( true, DynamicStore.PROPERTY_KEY ); RecordCheck<PropertyKeyTokenRecord, ConsistencyReport.PropertyKeyTokenConsistencyReport> checker = decorator.decoratePropertyKeyTokenChecker( dummyPropertyKeyCheck() ); DynamicRecord dynamic = records.addPropertyKeyName( inUse( string( new DynamicRecord( 42 ) ) ) ); PropertyKeyTokenRecord record1 = records.add( inUse( new PropertyKeyTokenRecord( 1 ) ) ); PropertyKeyTokenRecord record2 = records.add( inUse( new PropertyKeyTokenRecord( 2 ) ) ); record1.setNameId( (int) dynamic.getId() ); record2.setNameId( (int) dynamic.getId() ); ConsistencyReport.PropertyKeyTokenConsistencyReport report1 = check( ConsistencyReport.PropertyKeyTokenConsistencyReport.class, checker,record1, records ); ConsistencyReport.PropertyKeyTokenConsistencyReport report2 = check( ConsistencyReport.PropertyKeyTokenConsistencyReport.class, checker,record2, records ); verifyNoMoreInteractions( report1 ); verify( report2 ).nameMultipleOwners( record1 ); verifyNoMoreInteractions( report2 ); }