code: public boolean isPolicyExceeded() {
      boolean withinMaxRetries = maxAttempts == -1 || attemptCount < maxAttempts;
      boolean withinMaxDuration = maxDuration == -1 || System.nanoTime() - startTime < maxDuration;
      return !withinMaxRetries || !withinMaxDuration;
    }
docs: Returns true if the max attempts or max duration for the recurring policy have been exceeded
  else false.