@Test
public void clear() throws Exception {

    RoundRobinLoadBalancedList<String> list = new RoundRobinLoadBalancedList<String>();
    // add two items
    list.set("Item1", 1);
    list.set("Item2", 1);
    logger.debug("Initial list: " + list.toString());
    Assert.assertEquals(2, list.getRemainingSize());
    Assert.assertEquals("Item1", list.getNext());
    Assert.assertEquals("Item2", list.getNext());
    Assert.assertEquals(2, list.getSize());
    Assert.assertEquals(2, list.getRemainingSize());
    // clear it
    list.clear();
    Assert.assertEquals(0, list.getSize());
    Assert.assertEquals(0, list.getRemainingSize());
    Assert.assertEquals(null, list.getNext());
}