Code example for BitSet

Methods: get, length, size

0
 
        bs = new BitSet();
        bs.set(63);
        assertTrue("Test highest bit", bs.get(63));
 
        bs = new BitSet(0);
        assertEquals("Test1: Wrong length,", 0, bs.length());
        assertEquals("Test1: Wrong size,", 0, bs.size());
 
        bs.get(2);
        assertEquals("Test2: Wrong length,", 0, bs.length());
        assertEquals("Test2: Wrong size,", 0, bs.size());
 
        bs.get(70);
        assertEquals("Test3: Wrong length,", 0, bs.length());
        assertEquals("Test3: Wrong size,", 0, bs.size());
 
    } 
 
    /** 
     * @tests java.util.BitSet#get(int, int)