### Question:
SyncState { public void setSyncTarget(final EthPeer peer, final BlockHeader commonAncestor) { final SyncTarget syncTarget = new SyncTarget(peer, commonAncestor); replaceSyncTarget(Optional.of(syncTarget)); } SyncState(final Blockchain blockchain, final EthPeers ethPeers); long subscribeInSync(final InSyncListener listener); long subscribeInSync(final InSyncListener listener, final long syncTolerance); boolean unsubscribeInSync(final long subscriberId); long subscribeSyncStatus(final SyncStatusListener listener); boolean unsubscribeSyncStatus(final long listenerId); Optional<SyncStatus> syncStatus(); Optional<SyncTarget> syncTarget(); void setSyncTarget(final EthPeer peer, final BlockHeader commonAncestor); void setWorldStateDownloadStatus(final WorldStateDownloadStatus worldStateDownloadStatus); boolean isInSync(); boolean isInSync(final long syncTolerance); void disconnectSyncTarget(final DisconnectReason reason); void clearSyncTarget(); long bestChainHeight(); long bestChainHeight(final long localChainHeight);  }### Answer:
@Test public void syncStatusListener_receivesEventWhenSyncTargetSet() { syncState.setSyncTarget(syncTargetPeer.getEthPeer(), blockchain.getBlockHeader(3L).get()); verify(syncStatusListener).onSyncStatusChanged(syncStatusCaptor.capture()); assertThat(syncStatusCaptor.getAllValues()).hasSize(1); final Optional<SyncStatus> syncStatus = syncStatusCaptor.getValue(); assertThat(syncStatus).isPresent(); assertThat(syncStatus.get().getStartingBlock()).isEqualTo(3L); assertThat(syncStatus.get().getCurrentBlock()).isEqualTo(OUR_CHAIN_HEAD_NUMBER); assertThat(syncStatus.get().getHighestBlock()).isEqualTo(TARGET_CHAIN_HEIGHT); }