private static void checkWaitTimeMsArgs(int attempts, int maxAttempts) {
    if (attempts < 1 || attempts >= maxAttempts) {
      throw new IllegalArgumentException(
          "Number of attempts (" + attempts + ") must be in the range [1," + maxAttempts + ")");
    }
  }
@param attempts  the number of attempts provided as an argument to {@link RetryPolicy#waitTimeMs}.
@param maxAttempts the maximum number of attempts for the policy
@throws IllegalArgumentException if {@code attempts} is not in the range {@code [1, maxAttempts)}
ambry-commons/src/main/java/com/github/ambry/commons/RetryPolicies.java