### Question:
BlockchainQueries { public Optional<BlockWithMetadata<TransactionWithMetadata, Hash>> latestBlock() { return this.blockByHash(blockchain.getChainHeadHash()); } BlockchainQueries(final Blockchain blockchain, final WorldStateArchive worldStateArchive);  BlockchainQueries(
      final Blockchain blockchain,
      final WorldStateArchive worldStateArchive,
      final EthScheduler scheduler);  BlockchainQueries(
      final Blockchain blockchain,
      final WorldStateArchive worldStateArchive,
      final Optional<Path> cachePath,
      final Optional<EthScheduler> scheduler); Blockchain getBlockchain(); WorldStateArchive getWorldStateArchive(); Optional<TransactionLogBloomCacher> getTransactionLogBloomCacher(); Optional<Hash> getBlockHashByNumber(final long number); long headBlockNumber(); Optional<UInt256> storageAt(
      final Address address, final UInt256 storageIndex, final long blockNumber); Optional<Wei> accountBalance(final Address address, final long blockNumber); Optional<Bytes> getCode(final Address address, final long blockNumber); Optional<Integer> getTransactionCount(final long blockNumber); Integer getTransactionCount(final Hash blockHeaderHash); long getTransactionCount(final Address address, final long blockNumber); long getTransactionCount(final Address address); Optional<Integer> getOmmerCount(final long blockNumber); Optional<Integer> getOmmerCount(final Hash blockHeaderHash); Optional<Integer> getOmmerCount(); Optional<BlockHeader> getOmmer(final Hash blockHeaderHash, final int index); Optional<BlockHeader> getOmmer(final long blockNumber, final int index); Optional<BlockHeader> getOmmer(final int index); Optional<BlockWithMetadata<TransactionWithMetadata, Hash>> blockByHash(
      final Hash blockHeaderHash); Optional<BlockWithMetadata<TransactionWithMetadata, Hash>> blockByNumber(
      final long number); Optional<BlockWithMetadata<TransactionWithMetadata, Hash>> latestBlock(); Optional<BlockWithMetadata<Hash, Hash>> blockByHashWithTxHashes(
      final Hash blockHeaderHash); Optional<BlockWithMetadata<Hash, Hash>> blockByNumberWithTxHashes(final long blockNumber); Optional<BlockHeader> getBlockHeaderByHash(final Hash hash); Optional<BlockHeader> getBlockHeaderByNumber(final long number); boolean blockIsOnCanonicalChain(final Hash hash); Optional<BlockWithMetadata<Hash, Hash>> latestBlockWithTxHashes(); Optional<TransactionWithMetadata> transactionByHash(final Hash transactionHash); Optional<TransactionWithMetadata> transactionByBlockNumberAndIndex(
      final long blockNumber, final int txIndex); Optional<TransactionWithMetadata> transactionByBlockHashAndIndex(
      final Hash blockHeaderHash, final int txIndex); Optional<TransactionLocation> transactionLocationByHash(final Hash transactionHash); Optional<TransactionReceiptWithMetadata> transactionReceiptByTransactionHash(
      final Hash transactionHash); List<LogWithMetadata> matchingLogs(
      final long fromBlockNumber,
      final long toBlockNumber,
      final LogsQuery query,
      final Supplier<Boolean> isQueryAlive); List<LogWithMetadata> matchingLogs(
      final Hash blockHash, final LogsQuery query, final Supplier<Boolean> isQueryAlive); Optional<MutableWorldState> getWorldState(final long blockNumber);  }### Answer:
@Test public void getLatestBlock() { final BlockchainWithData data = setupBlockchain(3); final BlockchainQueries queries = data.blockchainQueries; final Block targetBlock = data.blockData.get(2).block; final BlockWithMetadata<TransactionWithMetadata, Hash> result = queries.latestBlock().get(); assertBlockMatchesResult(targetBlock, result); }