Code example for Vector

Methods: add, remove

0
        public void set(E o) {
        } 
    } 
     
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "addAll", 
        args = {int.class, java.util.Collection.class}
    ) 
    public void test_addAllILjava_util_Collection() { 
        AbstractSequentialList asl = new AbstractSequentialList() {
 
            @Override 
            public int size() { 
                return 0; 
            } 
 
            @Override 
            public ListIterator listIterator(int index) {
                return new Mock_unsupportedListIterator(); 
            } 
        }; 
        Collection strV = new Vector<String>();
         
        strV.add("String");
        strV.add("1");
        strV.add("3.14");
 
        try { 
            asl.addAll(0, strV);
            fail("UnsupportedOperationException expected.");
        } catch (UnsupportedOperationException ee) {
            //expected 
        } 
        try { 
            asl.addAll(0, null);
            fail("NullPointerException expected");
        } catch (NullPointerException ee) {
            //expected 
        } 
 
        //ClassCastException can not be checked for this method. 
 
        asl = new AbstractSequentialList() {
 
            @Override 
            public int size() { 
                return 0; 
            } 
 
            @Override 
            public ListIterator listIterator(int index) {
                return new Mock_ListIterator(); 
            } 
        }; 
         
        try { 
            asl.addAll(0, strV);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            //expected