Code example for BitSet

Methods: clear, clone, hashCode, set

0
    /** 
     * @tests java.util.BitSet#hashCode() 
     */ 
    public void test_hashCode() { 
        // Test for method int java.util.BitSet.hashCode() 
        BitSet bs = (BitSet) eightbs.clone();
        bs.clear(2);
        bs.clear(6);
        assertEquals("BitSet returns wrong hash value", 1129, bs.hashCode());
        bs.set(10);
        bs.clear(3);
        assertEquals("BitSet returns wrong hash value", 97, bs.hashCode());
    } 
 
    /** 
     * @tests java.util.BitSet#clear() 
     */ 
    public void test_clear() { 
        eightbs.clear();
        for (int i = 0; i < 8; i++) {
            assertFalse("Clear didn't clear bit " + i, eightbs.get(i));