code: public void trimToSize() {
          modCount++;
          int oldCapacity = elementData.length;
          if (size < oldCapacity) {
              elementData = Arrays.copyOf(elementData, size);
          }
      }
docs: Trims the capacity of this <tt>IdentityArrayList</tt> instance to be the
  list's current size.  An application can use this operation to minimize
  the storage of an <tt>IdentityArrayList</tt> instance.