code: public void setMinMaxLength(int[] lengths) {
      Arrays.sort(lengths);
      this.minLength = lengths[0];
      this.maxLength = lengths[lengths.length - 1];
    }
docs: Set min and max lengths.
  
  @param lengths the lengths to set.