OpenBitSet uses an internal buffer of long variables to store set bits and an additional 'wlen' index that points
to the highest used component inside
Unlike in JDK, the wlen field is not continuously maintained (on clearing bits, for example). This leads to a situation when wlen may point
far beyond the last set bit.
The hashCode implementation iterates over all long components of the bits buffer, rotating the hash even for empty components. This is against the contract of hashCode-equals. The following test case illustrates this:
Fix and test case attached.