OpenBitSet didn't had this restriction and it seems nice behaviour to me as user of this class if nextSetBit() just returned -1 if I go beyond the max size of the bit set.