@Test public void getNext() throws Exception { LoadBalancedList<String> list = LoadBalancedLists.synchronizedList(new RoundRobinLoadBalancedList<String>()); list.set("Item1", 1); for (int i = 0; i < 50; i++) { Assert.assertTrue("Failed on i=" + i, "Item1".equals(list.getNext())); } list.remove("Item1"); for (int i = 0; i < 50; i++) { Assert.assertTrue("Failed on i=" + i, list.getNext() == null); } list.set("Item2", 1); for (int i = 0; i < 50; i++) { Assert.assertTrue("Failed on i=" + i, "Item2".equals(list.getNext())); } list.set("Item2", 0); for (int i = 0; i < 50; i++) { Assert.assertTrue("Failed on i=" + i, list.getNext() == null); } }
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);  }