shadows/framework/src/main/java/org/robolectric/shadows/NativeBitSet64.java
int getIndexOfBit(int n) {
    // return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));
    int numMarkedBits = 0;
    for (int i = 0; i < n; i++) {
      if (hasBit(i)) {
        numMarkedBits++;
      }
    }
    return numMarkedBits;
  }
int getIndexOfBit(int n) {
    // return __builtin_popcountll(value & ~(0xffffffffffffffffULL >> n));
    int numMarkedBits = 0;
    for (int i = 0; i < n; i++) {
      if (hasBit(i)) {
        numMarkedBits++;
      }
    }
    return numMarkedBits;
  }
Gets the index of the specified bit in the set, which is the number of marked bits that appear
before the specified bit.