### Question:
PropertyReader implements NodePropertyAccessor { Collection<PropertyRecord> getPropertyRecordChain( long firstPropertyRecordId ) throws CircularPropertyRecordChainException { List<PropertyRecord> records = new ArrayList<>(); visitPropertyRecordChain( firstPropertyRecordId, record -> { records.add( record ); return false; } ); return records; } PropertyReader( StoreAccess storeAccess ); Value propertyValue( PropertyBlock block ); @Override Value getNodePropertyValue( long nodeId, int propertyKeyId );  }### Answer:
@Test public void shouldDetectAndAbortPropertyChainLoadingOnCircularReference() throws IOException { NeoStores neoStores = storesRule.builder().build(); PropertyStore propertyStore = neoStores.getPropertyStore(); PropertyRecord record = propertyStore.newRecord(); record.setId( 1 ); record.initialize( true, -1, 2 ); propertyStore.updateRecord( record ); record.setId( 2 ); record.initialize( true, 1, 3 ); propertyStore.updateRecord( record ); record.setId( 3 ); record.initialize( true, 2, 4 ); propertyStore.updateRecord( record ); record.setId( 4 ); record.initialize( true, 3, 2 ); propertyStore.updateRecord( record ); PropertyReader reader = new PropertyReader( new StoreAccess( neoStores ) ); try { reader.getPropertyRecordChain( 1 ); fail( "Should have detected circular reference" ); } catch ( PropertyReader.CircularPropertyRecordChainException e ) { assertEquals( 4, e.propertyRecordClosingTheCircle().getId() ); } }