code: public static int nextSetBit(long v, int start) {
      if(start >= Long.SIZE) {
        return -1;
      }
      start = start < 0 ? 0 : start;
      long cur = v & (LONG_ALL_BITS << start);
      return cur == 0 ? -1 : cur == LONG_ALL_BITS ? 0 : Long.numberOfTrailingZeros(cur);
    }
docs: Find the next set bit.
  
  @param v Value to process
  @param start Start position (inclusive)
  @return Position of next set bit, or -1.