### Question:
MetaDataStore extends CommonAbstractStore<MetaDataRecord,NoStoreHeader> implements TransactionIdStore, LogVersionRepository { public static long versionStringToLong( String storeVersion ) { if ( CommonAbstractStore.UNKNOWN_VERSION.equals( storeVersion ) ) { return -1; } Bits bits = Bits.bits( 8 ); int length = storeVersion.length(); if ( length == 0 || length > 7 ) { throw new IllegalArgumentException( format( "The given string %s is not of proper size for a store version string", storeVersion ) ); } bits.put( length, 8 ); for ( int i = 0; i < length; i++ ) { char c = storeVersion.charAt( i ); if ( c >= 256 ) { throw new IllegalArgumentException( format( "Store version strings should be encode-able as Latin1 - %s is not", storeVersion ) ); } bits.put( c, 8 ); } return bits.getLong(); } MetaDataStore( File file, File idFile, Config conf,
            IdGeneratorFactory idGeneratorFactory,
            PageCache pageCache, LogProvider logProvider, RecordFormat<MetaDataRecord> recordFormat,
            String storeVersion,
            OpenOption... openOptions ); @Override void setLastCommittedAndClosedTransactionId(
            long transactionId, long checksum, long commitTimestamp, long byteOffset, long logVersion ); static long setRecord( PageCache pageCache, File neoStore, Position position, long value ); static long getRecord( PageCache pageCache, File neoStore, Position position ); StoreId getStoreId(); static StoreId getStoreId( PageCache pageCache, File neoStore ); long getUpgradeTime(); void setUpgradeTime( long time ); void setUpgradeTransaction( long id, long checksum, long timestamp ); long getCreationTime(); void setCreationTime( long time ); long getRandomNumber(); void setRandomNumber( long nr ); @Override long getCurrentLogVersion(); @Override void setCurrentLogVersion( long version ); void setLastTransactionCommitTimestamp( long timestamp ); @Override long incrementAndGetVersion(); long getStoreVersion(); void setStoreVersion( long version ); long getGraphNextProp(); void setGraphNextProp( long propId ); long getLatestConstraintIntroducingTx(); void setLatestConstraintIntroducingTx( long latestConstraintIntroducingTx ); NeoStoreRecord graphPropertyRecord(); static long versionStringToLong( String storeVersion ); static String versionLongToString( long storeVersion ); @Override long nextCommittingTransactionId(); @Override long committingTransactionId(); @Override void transactionCommitted( long transactionId, long checksum, long commitTimestamp ); @Override long getLastCommittedTransactionId(); @Override TransactionId getLastCommittedTransaction(); @Override TransactionId getUpgradeTransaction(); @Override long getLastClosedTransactionId(); @Override void awaitClosedTransactionId( long txId, long timeoutMillis ); @Override long[] getLastClosedTransaction(); @Override void transactionClosed( long transactionId, long logVersion, long byteOffset ); void logRecords( final Logger msgLog ); @Override MetaDataRecord newRecord(); @Override void accept(
            org.neo4j.kernel.impl.store.RecordStore.Processor<FAILURE> processor, MetaDataRecord record ); @Override void prepareForCommit( MetaDataRecord record ); @Override void prepareForCommit( MetaDataRecord record, IdSequence idSequence ); static final String TYPE_DESCRIPTOR; static final long FIELD_NOT_INITIALIZED; }### Answer:
@Test public void mustSupportScanningAllRecords() throws Exception { File file = createMetaDataFile(); MetaDataStore.Position[] positions = MetaDataStore.Position.values(); long storeVersion = versionStringToLong( Standard.LATEST_RECORD_FORMATS.storeVersion()); writeCorrectMetaDataRecord( file, positions, storeVersion ); List<Long> actualValues = new ArrayList<>(); try ( MetaDataStore store = newMetaDataStore() ) { store.scanAllRecords( record -> { actualValues.add( record.getValue() ); return false; } ); } List<Long> expectedValues = Arrays.stream( positions ).map( p -> { if ( p == MetaDataStore.Position.STORE_VERSION ) { return storeVersion; } else { return p.ordinal() + 1L; } } ).collect( Collectors.toList() ); assertThat( actualValues, is( expectedValues ) ); }