code: public void limitMaximumHitCount(int limit) {
  
      Integer max = getMaximumHitCount();
      if ((max == null) || (max.intValue() > limit)) {
        setMaximumHitCount(Integer.valueOf(limit));
      }
    }
docs: Limits the {@link #getMaximumHitCount() maximum hit count} by the given {@code limit}. If current
  {@link #getMaximumHitCount() maximum hit count} is {@code null} or greater than the given {@code limit}, the value
  is replaced by {@code limit}.
  
  @param limit is the maximum allowed value for {@link #getMaximumHitCount() maximum hit count}.
  @since 6.0.0