code: private void enlargeCapacity(int key) {
  	int diff = offCount - offset;
  	int minCapacity = Math.max(arr.length, key + offset + diff + 1);
  
  	if (minCapacity > arr.length) {
  	    int oldCapacity = arr.length;
  	    int newCapacity = oldCapacity + (oldCapacity >> 1);
  	    if (newCapacity - minCapacity < 0) newCapacity = minCapacity;
  	    if (newCapacity - MAX_ARRAY_SIZE > 0) newCapacity = hugeCapacity(minCapacity);
  	    // minCapacity is usually close to size, so this is a win:
  	    arr = Arrays.copyOf(arr, newCapacity);
  	}
      }
docs: !!! all methods that use this method must be sync enlarge the inner array to given size
  
  @param key min size of the array