### Question:
SyncStateTracker extends Service { public SyncState getCurrentSyncState() { return currentState; } SyncStateTracker(
      final AsyncRunner asyncRunner,
      final SyncService syncService,
      final P2PNetwork<? extends Peer> network,
      final int startupTargetPeerCount,
      final Duration startupTimeout); SyncState getCurrentSyncState();  }### Answer:
@Test public void shouldStartInSyncWhenTargetPeerCountIsZero() { final SyncStateTracker tracker = new SyncStateTracker(asyncRunner, syncService, network, 0, STARTUP_TIMEOUT); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.IN_SYNC); }
@Test public void shouldStartInSyncWhenStartupTimeoutIsZero() { final SyncStateTracker tracker = new SyncStateTracker( asyncRunner, syncService, network, STARTUP_TARGET_PEER_COUNT, Duration.ofSeconds(0)); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.IN_SYNC); }
@Test void shouldReturnToInSyncAfterSyncCompletesIfStartupModeIsDisabled() { reset(syncService); final SyncStateTracker tracker = new SyncStateTracker( asyncRunner, syncService, network, STARTUP_TARGET_PEER_COUNT, Duration.ofSeconds(0)); tracker.start().join(); final ArgumentCaptor<SyncSubscriber> syncSubscriberArgumentCaptor = ArgumentCaptor.forClass(SyncSubscriber.class); verify(syncService).subscribeToSyncChanges(syncSubscriberArgumentCaptor.capture()); syncSubscriber = syncSubscriberArgumentCaptor.getValue(); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.IN_SYNC); syncSubscriber.onSyncingChange(true); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.SYNCING); syncSubscriber.onSyncingChange(false); assertThat(tracker.getCurrentSyncState()).isEqualTo(SyncState.IN_SYNC); }