code: @VisibleForTesting
      static Date parseRetryAfter(long now, Response response)
      {
          String retryAfter = response.header(RETRY_AFTER);
          if (retryAfter == null) {
              return null;
          }
          // Try parsing as a number of seconds first
          try {
              long retryAfterSeconds = Long.parseLong(retryAfter);
              return new Date(now + TimeUnit.SECONDS.toMillis(retryAfterSeconds));
          }
          catch (NumberFormatException e) {
              // Then try parsing as a HTTP-date
              try {
                  return HTTP_DATE_FORMAT.get().parse(retryAfter);
              }
              catch (ParseException ignore) {
                  logger.warn("Failed to parse Retry-After header: '" + retryAfter + "'");
                  return null;
              }
          }
      }
docs: https://tools.ietf.org/html/rfc7231#section-7.1.3