class CheckpointRangeSource implements Iterator<CheckpointRange> {

  @Override
  public boolean hasNext() {
    return !retrievedRanges.isEmpty()
        || (requestFailureCount < checkpointTimeoutsPermitted
            && syncTargetChecker.shouldContinueDownloadingFromSyncTarget(peer, lastRangeEnd)
            && !reachedEndOfCheckpoints);
  }

  public  CheckpointRangeSource(
      final CheckpointHeaderFetcher checkpointFetcher,
      final SyncTargetChecker syncTargetChecker,
      final EthScheduler ethScheduler,
      final EthPeer peer,
      final BlockHeader commonAncestor,
      final int checkpointTimeoutsPermitted);
    CheckpointRangeSource(
      final CheckpointHeaderFetcher checkpointFetcher,
      final SyncTargetChecker syncTargetChecker,
      final EthScheduler ethScheduler,
      final EthPeer peer,
      final BlockHeader commonAncestor,
      final int checkpointTimeoutsPermitted,
      final Duration newHeaderWaitDuration);

}