### Question:
MetaDataStore extends CommonAbstractStore<MetaDataRecord,NoStoreHeader> implements TransactionIdStore, LogVersionRepository { @Override public long[] getLastClosedTransaction() { assertNotClosed(); checkInitialized( lastCommittingTxField.get() ); return lastClosedTx.get(); } 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 getLastClosedTransactionShouldFailWhenStoreIsClosed() { MetaDataStore metaDataStore = newMetaDataStore(); metaDataStore.close(); try { metaDataStore.getLastClosedTransaction(); fail( "Expected exception reading from MetaDataStore after being closed." ); } catch ( Exception e ) { assertThat( e, instanceOf( IllegalStateException.class ) ); } }