}
protected void doSingle(int maxSize) {
int sz = rand.nextInt(maxSize+1);
int sz2 = rand.nextInt(maxSize);
OpenBitSet a1 = getRandomSet(sz, rand.nextInt(sz+1));
OpenBitSet a2 = getRandomSet(sz, rand.nextInt(sz2+1));
DocSet b1 = getDocSet(a1);
DocSet b2 = getDocSet(a2);
// System.out.println("b1="+b1+", b2="+b2);
assertEquals((int)a1.cardinality(), b1.size());
assertEquals((int)a2.cardinality(), b2.size());
checkEqual(a1,b1);
checkEqual(a2,b2);
OpenBitSet a_and = (OpenBitSet)a1.clone(); a_and.and(a2);
OpenBitSet a_or = (OpenBitSet)a1.clone(); a_or.or(a2);
// OpenBitSet a_xor = (OpenBitSet)a1.clone(); a_xor.xor(a2);
OpenBitSet a_andn = (OpenBitSet)a1.clone(); a_andn.andNot(a2);
checkEqual(a_and, b1.intersection(b2));
checkEqual(a_or, b1.union(b2));
checkEqual(a_andn, b1.andNot(b2));
assertEquals(a_and.cardinality(), b1.intersectionSize(b2));
assertEquals(a_or.cardinality(), b1.unionSize(b2));
assertEquals(a_andn.cardinality(), b1.andNotSize(b2));
}