### Question:
PendingBlocks { public boolean deregisterPendingBlock(final Block block) { final Hash parentHash = block.getHeader().getParentHash(); final Block removed = pendingBlocks.remove(block.getHash()); final Set<Hash> blocksForParent = pendingBlocksByParentHash.get(parentHash); if (blocksForParent != null) { blocksForParent.remove(block.getHash()); pendingBlocksByParentHash.remove(parentHash, Collections.emptySet()); } return removed != null; }  boolean registerPendingBlock(final Block pendingBlock); boolean deregisterPendingBlock(final Block block); void purgeBlocksOlderThan(final long blockNumber); boolean contains(final Hash blockHash); List<Block> childrenOf(final Hash parentBlock);  }### Answer:
@Test public void deregisterPendingBlock() { final Block block = gen.block(); pendingBlocks.registerPendingBlock(block); pendingBlocks.deregisterPendingBlock(block); assertThat(pendingBlocks.contains(block.getHash())).isFalse(); final List<Block> pendingBlocksForParent = pendingBlocks.childrenOf(block.getHeader().getParentHash()); assertThat(pendingBlocksForParent).isEqualTo(Collections.emptyList()); }