Examples of ResizingArrayList


Examples of nextapp.echo2.app.util.ResizingArrayList

    /**
     * Test randomly setting values.
     */
    public void testRandomSetCalls() {
        for (int i = 0; i < 10; ++i) {
            List list = new ResizingArrayList();
            for (int j = 0; j < 10; ++j) {
                int setIndex = (int) (Math.random() * 100);
                list.set(setIndex, new Integer(setIndex));
            }
            int size = list.size();
            for (int j = 0; j < size; ++j) {
                Integer value = (Integer) list.get(j);
                assertTrue(value == null || value.intValue() == j);
            }
        }
    }
View Full Code Here

Examples of nextapp.echo2.app.util.ResizingArrayList

    /**
     * Test setting and removing values.
     */
    public void testSetAndRemove() {
        List list = new ResizingArrayList();
        list.set(4, "foo");
        assertEquals(5, list.size());
        assertEquals("foo", list.get(4));
        list.remove(4);
        assertEquals(0, list.size());
        list.set(4, "foo");
        assertEquals("foo", list.get(4));
        assertTrue(list.remove("foo"));
        assertEquals(0, list.size());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.