code: public void ensureCapacity(int minCapacity) {
          int minExpand = (elementData != DEFAULTCAPACITY_EMPTY_ELEMENTDATA)
              // any size if not default element table
              ? 0
              // larger than default for default empty table. It's already
              // supposed to be at default size.
              : DEFAULT_CAPACITY;
  
          if (minCapacity > minExpand) {
              ensureExplicitCapacity(minCapacity);
          }
      }
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