@Test public void getNextEqualWeight() throws Exception { LoadBalancedList<String> list = LoadBalancedLists.synchronizedList(new RoundRobinLoadBalancedList<String>()); list.set("Item1", 2); list.set("Item2", 2); list.set("Item3", 2); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); list.set("Item1", 1); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); list.set("Item1", 2); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); Assert.assertEquals("Item3", list.getNext()); Assert.assertEquals("Item1", list.getNext()); Assert.assertEquals("Item2", list.getNext()); }
static public <E> LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list) { return new ConcurrentLoadBalancedList<E>(list); }
LoadBalancedLists { static public <E> LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list) { return new ConcurrentLoadBalancedList<E>(list); } }
LoadBalancedLists { static public <E> LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list) { return new ConcurrentLoadBalancedList<E>(list); }  }
LoadBalancedLists { static public <E> LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list) { return new ConcurrentLoadBalancedList<E>(list); }  static LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list); }
LoadBalancedLists { static public <E> LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list) { return new ConcurrentLoadBalancedList<E>(list); }  static LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list);  }