### Question:
TimelinessValidator { public boolean addBlockHash(byte[] blockHash, long ancestorBlockNum, byte[] ancestorBlockHash, HashSet<ByteArrayWrapper> txSet){ if(this.validateBlockHash(blockHash,ancestorBlockNum,ancestorBlockHash)){ ValidateBlock pendingBlock = new ValidateBlock(blockHash,ancestorBlockNum,ancestorBlockHash,txSet); pendingBlockCache.put(new ByteArrayWrapper(blockHash),pendingBlock); return true; } return false; } TimelinessValidator();  TimelinessValidator(Map<Long,ValidateBlock> map, long maxAncestorBlockNum); boolean validateBlockHash(byte[] blockHash,long ancestorBlockNum,byte[] ancestorBlockHash); boolean addBlockHash(byte[] blockHash, long ancestorBlockNum, byte[] ancestorBlockHash, HashSet<ByteArrayWrapper> txSet); boolean addAncestorBlockHash(byte[] blockHash,long blockNum,byte[] ancestorBlockHash,long ancestorBlockNum,HashSet<ByteArrayWrapper> txSet); boolean validateTxHash(byte[] txHash,long ancestorBlockNum,byte[] ancestorBlockHash); boolean addTxHash(byte[] txHash,long ancestorBlockNum,byte[] ancestorBlockHash);  }### Answer:
@Test public void addBlockHash() { TimelinessValidator timelinessValidator = this.addHash(); Assert.assertTrue(timelinessValidator.addBlockHash(blockHash,ancestorBlockNum,ancestorBlockHash,null)); Assert.assertFalse(timelinessValidator.addBlockHash(blockHash,ancestorBlockNum,ancestorBlockHash,null)); }