class SyncController {

  public void onTargetChainsUpdated() {
    eventThread.checkOnEventThread();
    final boolean currentlySyncing = isSyncActive();
    final Optional<InProgressSync> newSync = selectNewSyncTarget(currentlySyncing);
    if (newSync.isEmpty() && currentlySyncing) {
      return;
    }
    if (!currentlySyncing && newSync.isPresent()) {
      notifySubscribers(true);
    }
    currentSync = newSync;
  }

  public  SyncController(
      final EventThread eventThread,
      final Executor subscriberExecutor,
      final RecentChainData recentChainData,
      final ChainSelector finalizedTargetChainSelector,
      final ChainSelector nonfinalizedTargetChainSelector,
      final Sync sync);

}