### Question:
TransactionChecksumLookup { public long lookup( long txId ) throws IOException { TransactionId lastCommittedTransaction = transactionIdStore.getLastCommittedTransaction(); if ( lastCommittedTransaction.transactionId() == txId ) { return lastCommittedTransaction.checksum(); } if ( upgradeTransaction.transactionId() == txId ) { return upgradeTransaction.checksum(); } try { return logicalTransactionStore.getMetadataFor( txId ).getChecksum(); } catch ( NoSuchTransactionException e ) { throw withMessage( e, e.getMessage() + " | transaction id store says last transaction is " + lastCommittedTransaction + " and last upgrade transaction is " + upgradeTransaction ); } } TransactionChecksumLookup( TransactionIdStore transactionIdStore,
            LogicalTransactionStore logicalTransactionStore ); long lookup( long txId );  }### Answer:
@Test public void lookupChecksumUsingUpgradeTransaction() throws Exception { TransactionChecksumLookup checksumLookup = new TransactionChecksumLookup( transactionIdStore, transactionStore ); assertEquals(2, checksumLookup.lookup( 2 )); }
@Test public void lookupChecksumUsingCommittedTransaction() throws Exception { TransactionChecksumLookup checksumLookup = new TransactionChecksumLookup( transactionIdStore, transactionStore ); assertEquals(1, checksumLookup.lookup( 1 )); }
@Test public void lookupChecksumUsingTransactionStore() throws Exception { TransactionChecksumLookup checksumLookup = new TransactionChecksumLookup( transactionIdStore, transactionStore ); assertEquals(3, checksumLookup.lookup( 3 )); }