### Question:
InventoryMsgHandler implements TronMsgHandler { @Override public void processMessage(PeerConnection peer, TronMessage msg) { InventoryMessage inventoryMessage = (InventoryMessage) msg; InventoryType type = inventoryMessage.getInventoryType(); if (!check(peer, inventoryMessage)) { return; } for (Sha256Hash id : inventoryMessage.getHashList()) { Item item = new Item(id, type); peer.getAdvInvReceive().put(item, System.currentTimeMillis()); advService.addInv(item); } }  @Override void processMessage(PeerConnection peer, TronMessage msg);  }### Answer:
@Test public void testProcessMessage() { InventoryMessage msg = new InventoryMessage(new ArrayList<>(), InventoryType.TRX); peer.setNeedSyncFromPeer(true); peer.setNeedSyncFromUs(true); handler.processMessage(peer, msg); peer.setNeedSyncFromPeer(true); peer.setNeedSyncFromUs(false); handler.processMessage(peer, msg); peer.setNeedSyncFromPeer(false); peer.setNeedSyncFromUs(true); handler.processMessage(peer, msg); }