code: public void ensureCapacity(int minCapacity) {
      modCount++;
      int oldCapacity = data.length;
      if (minCapacity > oldCapacity) {
        Object oldData[] = data;
        int newCapacity = (oldCapacity * 3) / 2 + 1;
        if (newCapacity < minCapacity)
          newCapacity = minCapacity;
        // minCapacity is usually close to size, so this is a win:
        data = Arrays.copyOf(data, newCapacity);
      }
    }
docs: Increases the capacity of this <tt>ArrayList</tt> instance, if
  necessary, to ensure that it can hold at least the number of elements
  specified by the minimum capacity argument.
  
  @param minCapacity the desired minimum capacity