@Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof OpenBitSet)) {
      return false;
    }
    OpenBitSet a;
    OpenBitSet b = (OpenBitSet) o;
    // make a the larger set.
    if (b.wlen > this.wlen) {
      a = b;
      b = this;
    } else {
      a = this;
    }

    int aPageSize = this.PAGE_SIZE;
    int bPageSize = b.PAGE_SIZE;

    // check for any set bits out of the range of b
    for (int i = a.wlen - 1; i >= b.wlen; i--) {
      if (a.bits[i / aPageSize][i % aPageSize] != 0) {
        return false;
      }
    }

    for (int i = b.wlen - 1; i >= 0; i--) {
      if (a.bits[i / aPageSize][i % aPageSize] != b.bits[i / bPageSize][i % bPageSize]) {
        return false;
      }
    }

    return true;
  }
returns true if both sets have the same bits set
ambry-utils/src/main/java/com/github/ambry/utils/OpenBitSet.java