int (final int actualLength, final int currentCapacity) { if (actualLength < 0) { throw new IllegalArgumentException("actualLength(=" + actualLength + " must be >=0"); } if (currentCapacity < actualLength) { throw new IllegalArgumentException("currentCapacity(=" + currentCapacity + ") must be >= actualLength(=" + actualLength + ")"); } if (currentCapacity > maxCapacity) { throw new IllegalArgumentException("currentCapacity(=" + currentCapacity + ") must be <= max(=" + maxCapacity + ")"); } return currentCapacity; }