RandomAccessIntContainer (int diff) { int expectedSize = size() + diff; if (expectedSize >= myThreshold) { upgrade(); } if (myInstanceHigh != null) { return myInstanceHigh.ensureContainerCapacity(diff); } else { return myInstanceLow.ensureContainerCapacity(diff); } }