@Test
public void testNodeListSimpleAddRemove() {

    ReplaySubject.NodeList<Integer> list = new ReplaySubject.NodeList<Integer>();
    
    assertEquals(0, list.size());
    
    // add and remove one
    
    list.addLast(1);
    assertEquals(1, list.size());
    
    assertEquals((Integer)1, list.removeFirst());
    assertEquals(0, list.size());
    // add and remove one again
    
    list.addLast(1);
    assertEquals(1, list.size());
    
    assertEquals((Integer)1, list.removeFirst());
    // add and remove two items
    
    list.addLast(1);
    list.addLast(2);
    assertEquals(2, list.size());
    assertEquals((Integer)1, list.removeFirst());
    assertEquals((Integer)2, list.removeFirst());
    assertEquals(0, list.size());
    // clear two items
    
    list.addLast(1);
    list.addLast(2);
    assertEquals(2, list.size());
    
    list.clear();
    assertEquals(0, list.size());
}