public void setMinMaxLength(int[] lengths) {
    Arrays.sort(lengths);
    this.minLength = lengths[0];
    this.maxLength = lengths[lengths.length - 1];
  }
public void setMinMaxLength ( int [ ] lengths ) { Arrays . sort ( lengths ) ; this . minLength = lengths [ 0 ] ; this . maxLength = lengths [ lengths . length - 1 ] ; }
Set min and max lengths.

@param lengths the lengths to set.