### Question:
IbftController { public void start() { if (started.compareAndSet(false, true)) { startNewHeightManager(blockchain.getChainHeadHeader()); } } IbftController(
      final Blockchain blockchain,
      final IbftFinalState ibftFinalState,
      final IbftBlockHeightManagerFactory ibftBlockHeightManagerFactory,
      final Gossiper gossiper,
      final MessageTracker duplicateMessageTracker,
      final FutureMessageBuffer futureMessageBuffer,
      final SynchronizerUpdater sychronizerUpdater); void start(); void handleMessageEvent(final IbftReceivedMessageEvent msg); void handleNewBlockEvent(final NewChainHead newChainHead); void handleBlockTimerExpiry(final BlockTimerExpiry blockTimerExpiry); void handleRoundExpiry(final RoundExpiry roundExpiry);  }### Answer:
@Test public void createsNewBlockHeightManagerWhenStarted() { constructIbftController(); verify(blockHeightManagerFactory, never()).create(chainHeadBlockHeader); ibftController.start(); verify(futureMessageBuffer, never()).addMessage(anyLong(), any()); verify(blockHeightManagerFactory).create(chainHeadBlockHeader); }
@Test public void startsNewBlockHeightManagerAndReplaysFutureMessages() { final ConsensusRoundIdentifier roundIdentifierHeight3 = new ConsensusRoundIdentifier(3, 0); setupPrepare(futureRoundIdentifier, validator); setupProposal(roundIdentifierHeight3, validator); setupCommit(futureRoundIdentifier, validator); setupRoundChange(futureRoundIdentifier, validator); final List<Message> height2Msgs = newArrayList(prepareMessage, commitMessage, roundChangeMessage); when(blockHeightManager.getChainHeight()).thenReturn(2L); when(futureMessageBuffer.retrieveMessagesForHeight(2L)).thenReturn(height2Msgs); constructIbftController(); ibftController.start(); verify(futureMessageBuffer).retrieveMessagesForHeight(2L); verify(futureMessageBuffer, never()).retrieveMessagesForHeight(3L); verify(blockHeightManagerFactory).create(chainHeadBlockHeader); verify(blockHeightManager, atLeastOnce()).getChainHeight(); verify(blockHeightManager, never()).handleProposalPayload(proposal); verify(blockHeightManager).handlePreparePayload(prepare); verify(ibftGossip).send(prepareMessage); verify(blockHeightManager).handleCommitPayload(commit); verify(ibftGossip).send(commitMessage); verify(blockHeightManager).handleRoundChangePayload(roundChange); verify(ibftGossip).send(roundChangeMessage); }