assertEquals(3, child3.size());
}
public void testMultipleGen()
{
CopyOnWriteList cowList = new CopyOnWriteList();
assertEquals(0, cowList.getShareLevel());
cowList.add("v1");
cowList.add("v2");
cowList.add("v3");
assertEquals(0, cowList.getShareLevel());
assertEquals(3, cowList.size());
CopyOnWriteList child1 = cowList.fastCopy();
CopyOnWriteList child2 = child1.fastCopy();
CopyOnWriteList child3 = child2.fastCopy();
assertEquals(3, cowList.getShareLevel());
child3.add("v4");
assertEquals(2, cowList.getShareLevel());
assertEquals(3, cowList.size());
assertEquals(2, child1.getShareLevel());
assertEquals(2, child2.getShareLevel());
assertEquals(0, child3.getShareLevel());
assertEquals(3, child1.size());
assertEquals(3, child2.size());
assertEquals(4, child3.size());
}