code: public int nextBit(int x) {
          Assert.check(currentState != BitsState.UNKNOWN);
          int windex = x >>> wordshift;
          if (windex >= bits.length) {
              return -1;
          }
          int word = bits[windex] & ~((1 << (x & wordmask))-1);
          while (true) {
              if (word != 0) {
                  return (windex << wordshift) + trailingZeroBits(word);
              }
              windex++;
              if (windex >= bits.length) {
                  return -1;
              }
              word = bits[windex];
          }
      }
docs: Return the index of the least bit position &ge; x that is set.
  If none are set, returns -1.  This provides a nice way to iterate
  over the members of a bit set:
  <pre>{@code
  for (int i = bits.nextBit(0); i>=0; i = bits.nextBit(i+1)) ...
  }</pre>