### Question:
EthSynchronizerUpdater implements SynchronizerUpdater { @Override public void updatePeerChainState( final long knownBlockNumber, final PeerConnection peerConnection) { final EthPeer ethPeer = ethPeers.peer(peerConnection); if (ethPeer == null) { LOG.debug("Received message from a peer with no corresponding EthPeer."); return; } ethPeer.chainState().updateHeightEstimate(knownBlockNumber); } EthSynchronizerUpdater(final EthPeers ethPeers); @Override void updatePeerChainState(
      final long knownBlockNumber, final PeerConnection peerConnection);  }### Answer:
@Test public void ethPeerIsMissingResultInNoUpdate() { when(ethPeers.peer(any())).thenReturn(null); final EthSynchronizerUpdater updater = new EthSynchronizerUpdater(ethPeers); updater.updatePeerChainState(1, mock(PeerConnection.class)); verifyZeroInteractions(ethPeer); }
@Test public void chainStateUpdateIsAttemptedIfEthPeerExists() { when(ethPeers.peer(any())).thenReturn(ethPeer); when(ethPeer.chainState()).thenReturn(chainState); final EthSynchronizerUpdater updater = new EthSynchronizerUpdater(ethPeers); final long suppliedChainHeight = 6L; updater.updatePeerChainState(suppliedChainHeight, mock(PeerConnection.class)); verify(chainState, times(1)).updateHeightEstimate(eq(suppliedChainHeight)); }