use of org.apache.zookeeper.server.util.BitHashSet in project zookeeper by apache.
the class WatcherOrBitSetTest method testBitSet.
@Test
public void testBitSet() {
BitHashSet bset = new BitHashSet(0);
WatcherOrBitSet bitSet = new WatcherOrBitSet(bset);
assertEquals(0, bitSet.size());
Integer bit = 1;
assertFalse(bitSet.contains(1));
assertFalse(bitSet.contains(bit));
bset.add(bit);
assertTrue(bitSet.contains(1));
assertTrue(bitSet.contains(bit));
assertEquals(1, bitSet.size());
}
Aggregations