private int nextClearBit(int fromIndex) {
    int u = unitIndex(fromIndex);
    int testIndex = (fromIndex & BIT_INDEX_MASK);
    long unit = units[u] >> testIndex;

    if (unit == (WORD_MASK >> testIndex)) {
      testIndex = 0;
    }

    while ((unit == WORD_MASK) && (u < units.length - 1)) {
      unit = units[++u];
    }

    if (unit == WORD_MASK) {
      return -1; // could not find a clear bit
    }

    int result;
    if (unit == 0) {
      result = u * BITS_PER_UNIT + testIndex;
    } else {
      testIndex += trailingZeroCnt(~unit);
      result = ((u * BITS_PER_UNIT) + testIndex);
    }
    if (result > MAX_ID || result < 0) {
      return -1;
    } else {
      return result;
    }
  }
Returns the index of the first bit that is set to <code>false</code> that occurs on or after
the specified starting index.

@param fromIndex the index to start checking from (inclusive).
@return the index of the next clear bit.
geode-core/src/main/java/org/apache/geode/internal/UniqueIdGenerator.java