code: public static RequestLimitRule of(Duration duration, long limit) {
          checkDuration(duration);
          if (limit < 0) {
              throw new IllegalArgumentException("limit must be greater than zero.");
          }
          int durationSeconds = (int) duration.getSeconds();
          return new RequestLimitRule(durationSeconds, limit, durationSeconds);
      }
docs: Initialise a request rate limit. Imagine the whole duration window as being one large bucket with a single count.
  
  @param duration The time the limit will be applied over. The duration must be greater than 1 second.
  @param limit    A number representing the maximum operations that can be performed in the given duration.
  @return A limit rule.