private void ensureCapacity(int value) {
    if (value >= Bits.getMax(bits)) {
      int[] newBits = Bits.makeBitSet(Math.max(value + 1, 2 * Bits.getMax(bits)));
      System.arraycopy(bits, 0, newBits, 0, bits.length);
      bits = newBits;
    }
  }
Ensures that the bit set has the capacity to represent the given value.

@param value {@code >= 0;} value to represent
android/android_framework/dex-maker/src/main/java/com/android/dx/util/BitIntSet.java