test_class.declarator: logger = LoggerFactory.getLogger(LoadBalancedListsTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(LoadBalancedListsTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-util/src/test/java/com/cloudhopper/commons/util/LoadBalancedListsTest.java
test_class.identifier: LoadBalancedListsTest
test_case.body: @Test
      public void getNextEqualWeight() throws Exception {
          LoadBalancedList<String> list = LoadBalancedLists.synchronizedList(new RoundRobinLoadBalancedList<String>());
  
          // add just one item
          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());
  
          // k, now we repeat and every item is back in list of possible choices
          Assert.assertEquals("Item1", list.getNext());
          Assert.assertEquals("Item2", list.getNext());
          Assert.assertEquals("Item3", list.getNext());
  
          // used up all of them once, item1 would normally have 1 more use left
          // let's reset its weight to 1 (which should remove it from possible list)
          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());
  
          // reset weight of item1 back to two
          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());
          // cycle should repeat now...
          Assert.assertEquals("Item1", list.getNext());
          Assert.assertEquals("Item2", list.getNext());
      }
test_case.class_method_signature: LoadBalancedListsTest.getNextEqualWeight()
test_case.full_signature: @Test public void getNextEqualWeight()
test_case.identifier: getNextEqualWeight
test_case.invocations: synchronizedList set set set assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext set assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext set assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext assertEquals getNext
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getNextEqualWeight()
focal_class.file: ch-commons-util/src/main/java/com/cloudhopper/commons/util/LoadBalancedLists.java
focal_class.identifier: LoadBalancedLists
focal_class.class_method_signature: LoadBalancedLists.synchronizedList(LoadBalancedList<E> list)
focal_class.full_signature: static public LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list)
focal_class.identifier: synchronizedList
focal_class.modifiers: static public
focal_class.parameters: (LoadBalancedList<E> list)
focal_class.return: LoadBalancedList<E>
focal_class.signature: LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list)
focal_method.body: static public <E> LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list) {
          return new ConcurrentLoadBalancedList<E>(list);
      }
focal_method.class_method_signature: LoadBalancedLists.synchronizedList(LoadBalancedList<E> list)
focal_method.full_signature: static public LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list)
focal_method.identifier: synchronizedList
focal_method.modifiers: static public
focal_method.parameters: (LoadBalancedList<E> list)
focal_method.return: LoadBalancedList<E>
focal_method.signature: LoadBalancedList<E> synchronizedList(LoadBalancedList<E> list)