public void sort(){
  throwIfImmutable();
  if (!sorted) {
    Arrays.sort(values,0,size);
    sorted=true;
  }
}

public void sort ( ) { throwIfImmutable ( ) ; if ( ! sorted ) { Arrays . sort ( values , 0 , size ) ; sorted = true ; } }
sorts the elements in the list in - place .
