### Question:
PendingBlocks { public boolean registerPendingBlock(final Block pendingBlock) { final Block previousValue = this.pendingBlocks.putIfAbsent(pendingBlock.getHash(), pendingBlock); if (previousValue != null) { return false; } pendingBlocksByParentHash .computeIfAbsent( pendingBlock.getHeader().getParentHash(), h -> { final Set<Hash> set = newSetFromMap(new ConcurrentHashMap<>()); set.add(pendingBlock.getHash()); return set; }) .add(pendingBlock.getHash()); return true; }  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 registerPendingBlock() { final Block block = gen.block(); assertThat(pendingBlocks.contains(block.getHash())).isFalse(); pendingBlocks.registerPendingBlock(block); assertThat(pendingBlocks.contains(block.getHash())).isTrue(); final List<Block> pendingBlocksForParent = pendingBlocks.childrenOf(block.getHeader().getParentHash()); assertThat(pendingBlocksForParent).isEqualTo(Collections.singletonList(block)); }