### Question:
BlockHashLookup { public Hash getBlockHash(final long blockNumber) { final Hash cachedHash = hashByNumber.get(blockNumber); if (cachedHash != null) { return cachedHash; } while (searchStartHeader != null && searchStartHeader.getNumber() - 1 > blockNumber) { searchStartHeader = blockchain.getBlockHeader(searchStartHeader.getParentHash()).orElse(null); if (searchStartHeader != null) { hashByNumber.put(searchStartHeader.getNumber() - 1, searchStartHeader.getParentHash()); } } return hashByNumber.getOrDefault(blockNumber, Hash.ZERO); } BlockHashLookup(final ProcessableBlockHeader currentBlock, final Blockchain blockchain); Hash getBlockHash(final long blockNumber);  }### Answer:
@Test public void shouldReturnEmptyHashWhenRequestedBlockNotOnChain() { Assertions.assertThat(lookup.getBlockHash(CURRENT_BLOCK_NUMBER + 20)).isEqualTo(Hash.ZERO); }
@Test public void shouldReturnEmptyHashWhenParentBlockNotOnChain() { final BlockHashLookup lookupWithUnavailableParent = new BlockHashLookup( new BlockHeaderTestFixture().number(CURRENT_BLOCK_NUMBER + 20).buildHeader(), blockchain); Assertions.assertThat(lookupWithUnavailableParent.getBlockHash(CURRENT_BLOCK_NUMBER)) .isEqualTo(Hash.ZERO); }