code: public void trimToSize() {
  		modCount++;
  		int oldCapacity = elementData.length;
  		if (size < oldCapacity) {
  			long oldData[] = elementData;
  			elementData = new long[size];
  			System.arraycopy(oldData, 0, elementData, 0, size);
  		}
  	}
docs: Trims the capacity of this <tt>ArrayList</tt> instance to be the
  list's current size.  An application can use this operation to minimize
  the storage of an <tt>ArrayList</tt> instance.