@Override
  public T call() throws RetryException {
    while (true) {
      Instant start = clock.instant();
      attempts++;
      try {
        monitor.debug(
            () ->
                String.format(
                    "Attempt %d started, service: %s, dataType: %s",
                    attempts, service, dataType));
        return callable.call();
      } catch (Exception e) {
        mostRecentException = e;
        monitor.info(() -> "RetryingCallable caught an exception", e);
        long elapsedMillis = Duration.between(start, clock.instant()).toMillis();
        // TODO: do we want to reset anything (eg, number of retries) if we see a different
        // RetryStrategy?
        RetryStrategy strategy = retryStrategyLibrary.checkoutRetryStrategy(e);
        monitor.debug(
            () ->
                String.format(
                    "Attempt %d failed, using retry strategy: %s, service: %s, dataType: %s",
                    attempts, strategy.toString(), service, dataType));
        if (strategy.canTryAgain(attempts)) {
          long nextAttemptIntervalMillis =
              strategy.getRemainingIntervalMillis(attempts, elapsedMillis);
          monitor.debug(
              () ->
                  String.format(
                      "Strategy has %d remainingIntervalMillis after %d elapsedMillis",
                      nextAttemptIntervalMillis, elapsedMillis));
          if (nextAttemptIntervalMillis > 0L) {
            try {
              Thread.sleep(nextAttemptIntervalMillis);
              // wait is now complete, retry
            } catch (InterruptedException ie) {
              currentThread().interrupt();
              throw new RetryException(attempts, mostRecentException);
            }
          }
        } else {
          monitor.debug(
              () ->
                  String.format("Strategy canTryAgain returned false after %d retries", attempts));
          if (strategy.canSkip()) {
            throw new RetryException(attempts, mostRecentException, true);
          } else {
            throw new RetryException(attempts, mostRecentException);
          }
        }
      }
    }
  }
Tries to call the {@link Callable} given the class's {@link RetryStrategyLibrary}.

@return Whatever is returned by the {@link Callable}.
portability-types-transfer/src/main/java/org/datatransferproject/types/transfer/retry/RetryingCallable.java