public synchronized void trimToSize(){
  if (elementData.length != elementCount) {
    grow(elementCount);
  }
}

public synchronized void trimToSize ( ) { if ( elementData . length != elementCount ) { grow ( elementCount ) ; } }
sets the capacity of this vector to be the same as the size .
