Code example for ArrayList

Methods: add

0
    public void testSelectRoundRobin() throws Exception { 
        final Partition p1 = new Partition("0-1"); 
        final Partition p2 = new Partition("0-2"); 
        final Partition p3 = new Partition("0-3"); 
 
        final List<Partition> list = new ArrayList<Partition>(); 
        list.add(p1); 
        list.add(p2); 
        list.add(p3); 
 
        assertSame(p2, this.selector.getPartition("test", list, null)); 
        assertSame(p3, this.selector.getPartition("test", list, null)); 
        assertSame(p1, this.selector.getPartition("test", list, null)); 
        assertSame(p2, this.selector.getPartition("test", list, null)); 
        assertSame(p3, this.selector.getPartition("test", list, null)); 
        assertSame(p1, this.selector.getPartition("test", list, null)); 
    } 
 
}