code: public void ensureCapacity(final int required) {
          if (required <= 0) {
              return;
          }
          final int available = this.array.length - this.len;
          if (required > available) {
              expand(this.len + required);
          }
      }
docs: Ensures that the capacity is at least equal to the specified minimum.
  If the current capacity is less than the argument, then a new internal
  array is allocated with greater capacity. If the {@code required}
  argument is non-positive, this method takes no action.
  
  @param   required   the minimum required capacity.
  
  @since 4.1