code: public void ensureCapacity(int cap) {
          if (array.length < cap) {
              final int newCap = ArrayUtil.computeNewCapacity(array.length, cap);
              array = Arrays.copyOf(array, newCap);
              lock = false;
          }
      }
docs: Ensures that the internal storage has in total the given capacity.
  
  @param cap
  the minimum capacity to ensure