Code example for BitSet

Methods: andNotclearclonetoString

0
 
    /** 
     * @tests java.util.BitSet#andNot(java.util.BitSet) 
     */ 
    public void test_andNotLjava_util_BitSet() { 
        BitSet bs = (BitSet) eightbs.clone();
        bs.clear(5);
        BitSet bs2 = new BitSet();
        bs2.set(2);
        bs2.set(3);
        bs.andNot(bs2);
        assertEquals("Incorrect bitset after andNot",
                     "{0, 1, 4, 6, 7}", bs.toString());
 
        bs = new BitSet(0);
        bs.andNot(bs2);
        assertEquals("Incorrect size", 0, bs.size());
    } 
 
    /** 
     * @tests java.util.BitSet#or(java.util.BitSet)