@Override
  public boolean add(int bitIndex) {
    boolean set = contains(bitIndex);
    if (!set) {
      if (bitIndexBase < 0) {
        bitIndexBase = roundDownToSlot(bitIndex);
      }
      else if (bitIndex < bitIndexBase) {
        int newBase = roundDownToSlot(bitIndex);
        int wordDiff = (bitIndexBase - newBase) >> SHIFT;
        long[] n = new long[wordDiff + bitSlots.length];
        System.arraycopy(bitSlots, 0, n, wordDiff, bitSlots.length);
        bitSlots = n;
        bitIndexBase = newBase;
        maxNonZeroSlotIndex += wordDiff;
      }
      ++bitsSet;
      bitIndex -= bitIndexBase;
      int wordIndex = bitIndex >> SHIFT;
      if (wordIndex >= bitSlots.length) {
        bitSlots = ArrayUtil.realloc(bitSlots, Math.max(capacityWithReserve(bitSlots.length), wordIndex + 1));
      }
      bitSlots[wordIndex] |= 1L << (bitIndex & MASK);
      maxNonZeroSlotIndex = Math.max(maxNonZeroSlotIndex, wordIndex);
    }
    return !set;
  }
@Override
  public boolean add(int bitIndex)