Code example for BitSet

Methods: set, size

0
    /** 
     * @tests java.util.BitSet#size() 
     */ 
    public void test_size() { 
        // Test for method int java.util.BitSet.size() 
        assertEquals("Returned incorrect size", 64, eightbs.size());
        eightbs.set(129);
        assertTrue("Returned incorrect size", eightbs.size() >= 129);
 
    } 
 
    /** 
     * @tests java.util.BitSet#toString() 
     */ 
    public void test_toString() { 
        // Test for method java.lang.String java.util.BitSet.toString() 
        assertEquals("Returned incorrect string representation",
                     "{0, 1, 2, 3, 4, 5, 6, 7}", eightbs.toString());
        eightbs.clear(2);
        assertEquals("Returned incorrect string representation",
                     "{0, 1, 3, 4, 5, 6, 7}", eightbs.toString());