Code example for Vector

Methods: elements

0
        v.add(testStr); 
    } 
 
    @Test 
    public void testAdapter() { 
        Enumeration<String> enumeration = v.elements(); 
        Iterator iterator = new EnumerationIteratorAdapter(enumeration); 
 
        Assert.assertTrue(iterator.hasNext()); 
        Assert.assertEquals(testStr, iterator.next()); 
    } 
 
    @Test(expected = UnsupportedOperationException.class) 
    public void testAdapter_shouldThrowUnsupportedOperationException() { 
        Enumeration<String> enumeration = v.elements(); 
        Iterator iterator = new EnumerationIteratorAdapter(enumeration); 
        iterator.remove(); 
    } 
}