### Question:
BlockServiceConsumer implements BlockConsumer<T> { @Override public void broadcastBlock(ConsensusBlock<T> block) { try { BranchId branchId = block.getBranchId(); long nextIndex = branchGroup.getLastIndex(branchId) + 1; long receivedIndex = block.getIndex(); if (receivedIndex == nextIndex) { branchGroup.addBlock(block, true); } else { log.trace("Received blockIndex({}) is not nextBlockIndex({}).", block.getIndex(), nextIndex); } } catch (Exception e) { log.debug("BroadcastBlock() is failed. {}", e.getMessage()); } } BlockServiceConsumer(BranchGroup branchGroup); @Override void setListener(CatchUpSyncEventListener listener); @Override List<ConsensusBlock<T>> syncBlock(BranchId branchId, long offset, long limit); @Override void broadcastBlock(ConsensusBlock<T> block);  }### Answer:
@Test public void broadcastBlock() { assertEquals(0, branchGroup.getBranch(branchId).getBlockChainManager().getLastIndex()); ConsensusBlock<PbftProto.PbftBlock> nextBlock = BlockChainTestUtils.createNextBlock(); blockServiceConsumer.broadcastBlock(nextBlock); blockServiceConsumer.broadcastBlock(nextBlock); assertEquals(1, branchGroup.getBranch(branchId).getBlockChainManager().getLastIndex()); }