Code example for BitSet

Methods: sizetoString

0
 
    /** 
     * @tests java.util.BitSet#BitSet() 
     */ 
    public void test_Constructor() { 
        BitSet bs = new BitSet();
        assertEquals("Create BitSet of incorrect size", 64, bs.size());
        assertEquals("New BitSet had invalid string representation", "{}",
                     bs.toString());
    } 
 
    /** 
     * @tests java.util.BitSet#BitSet(int) 
     */ 
    public void test_ConstructorI() { 
        BitSet bs = new BitSet(128);
        assertEquals("Create BitSet of incorrect size", 128, bs.size());
        assertEquals("New BitSet had invalid string representation: "
                + bs.toString(), "{}", bs.toString());
        // All BitSets are created with elements of multiples of 64 
        bs = new BitSet(89);