Code example for BitSet

Methods: clear, clone, equals, set

0
    /** 
     * @tests java.util.BitSet#equals(java.lang.Object) 
     */ 
    public void test_equalsLjava_lang_Object() { 
        BitSet bs;
        bs = (BitSet) eightbs.clone();
        assertEquals("Same BitSet returned false", eightbs, eightbs);
        assertEquals("Identical BitSet returned false", bs, eightbs);
        bs.clear(6);
        assertFalse("Different BitSets returned true", eightbs.equals(bs));
 
        bs = (BitSet) eightbs.clone();
        bs.set(128);
        assertFalse("Different sized BitSet with higher bit set returned true",
                eightbs.equals(bs));
        bs.clear(128);
        assertTrue(
                "Different sized BitSet with higher bits not set returned false", 
                eightbs.equals(bs));
    } 
 
    /** 
     * @tests java.util.BitSet#hashCode() 
     */