code: private static boolean nextSleep(BackOff backoff, Sleeper sleeper, Exception currentException)
        throws InterruptedException {
      long backOffTime;
      try {
        backOffTime = backoff.nextBackOffMillis();
      } catch (IOException e) {
        throw new RuntimeException("Failed to to get next back off time", e);
      }
      if (backOffTime == BackOff.STOP) {
        return false;
      }
      logger.atInfo().withCause(currentException).log(
          "Transient exception caught. Sleeping for %d, then retrying.", backOffTime);
      sleeper.sleep(backOffTime);
      return true;
    }
docs: Determines the amount to sleep for and sleeps if needed.
  
  @param backoff BackOff to determine how long to sleep for
  @param sleeper Used to sleep
  @param currentException exception that caused the retry and sleep. For logging.
  @throws InterruptedException if sleep is interrupted