### Question:
BlockMsgHandler implements TronMsgHandler { @Override public void processMessage(PeerConnection peer, TronMessage msg) throws P2pException { BlockMessage blockMessage = (BlockMessage) msg; BlockId blockId = blockMessage.getBlockId(); if (!fastForward && !peer.isFastForwardPeer()) { check(peer, blockMessage); } if (peer.getSyncBlockRequested().containsKey(blockId)) { peer.getSyncBlockRequested().remove(blockId); syncService.processBlock(peer, blockMessage); } else { Long time = peer.getAdvInvRequest().remove(new Item(blockId, InventoryType.BLOCK)); long now = System.currentTimeMillis(); long interval = blockId.getNum() - tronNetDelegate.getHeadBlockId().getNum(); processBlock(peer, blockMessage.getBlockCapsule()); logger.info( "Receive block/interval {}/{} from {} fetch/delay {}/{}ms, txs/process {}/{}ms, witness: {}", blockId.getNum(), interval, peer.getInetAddress(), time == null ? 0 : now - time, now - blockMessage.getBlockCapsule().getTimeStamp(), ((BlockMessage) msg).getBlockCapsule().getTransactions().size(), System.currentTimeMillis() - now, Hex.toHexString(blockMessage.getBlockCapsule().getWitnessAddress().toByteArray())); } }  @Override void processMessage(PeerConnection peer, TronMessage msg);  }### Answer:
@Test public void testProcessMessage() { try { blockCapsule = new BlockCapsule(1, Sha256Hash.ZERO_HASH, System.currentTimeMillis(), Sha256Hash.ZERO_HASH.getByteString()); msg = new BlockMessage(blockCapsule); handler.processMessage(peer, new BlockMessage(blockCapsule)); } catch (P2pException e) { Assert.assertTrue(e.getMessage().equals("no request")); } try { List<Transaction> transactionList = Lists.newArrayList(); for (int i = 0; i < 1100000; i++) { transactionList.add(Transaction.newBuilder().build()); } blockCapsule = new BlockCapsule(1, Sha256Hash.ZERO_HASH.getByteString(), System.currentTimeMillis() + 10000, transactionList); msg = new BlockMessage(blockCapsule); System.out.println("len = " + blockCapsule.getInstance().getSerializedSize()); peer.getAdvInvRequest() .put(new Item(msg.getBlockId(), InventoryType.BLOCK), System.currentTimeMillis()); handler.processMessage(peer, msg); } catch (P2pException e) { System.out.println(e); Assert.assertTrue(e.getMessage().equals("block size over limit")); } try { blockCapsule = new BlockCapsule(1, Sha256Hash.ZERO_HASH, System.currentTimeMillis() + 10000, Sha256Hash.ZERO_HASH.getByteString()); msg = new BlockMessage(blockCapsule); peer.getAdvInvRequest() .put(new Item(msg.getBlockId(), InventoryType.BLOCK), System.currentTimeMillis()); handler.processMessage(peer, msg); } catch (P2pException e) { System.out.println(e); Assert.assertTrue(e.getMessage().equals("block time error")); } }