assertEquals(1, rel.size());
assertEquals(all.size(), el.size());
}
public void testClearOfDeeperList() {
EventList e = null;
final EventList el = EventLists.eventList(); e = el;
final List elReplay = new EventListReplayList(el);
final SortedEventList sel;
if (true) {
sel = EventLists.sortedEventList(e);
// keep a reverse sort
sel.setComparator(new Comparator() {
public int compare(final Object o1, final Object o2) {
final Comparable c1 = (Comparable)o1;
final Comparable c2 = (Comparable)o2;
return c2.compareTo(c1);
}
});
e = sel;
} else {
sel = null;
}
final List selReplay = sel != null ? new EventListReplayList(sel) : null;
final FilteredEventList fel;
if (!true) {
fel = EventLists.filteredEventList(e);
e = fel;
} else {
fel = null;
}
final List felReplay = fel != null ? new EventListReplayList(fel) : null;
final RangedEventList rel;
if (true) {
rel = createBackedRangedEventList(e);
rel.setMaxSize(4);
e = rel;
} else {
rel = null;
}
final List relReplay = rel != null ? new EventListReplayList(rel) : null;
// don't change the order
el.add(new Integer(25));
el.add(new Integer(33));
el.add(new Integer(55));
el.add(new Integer(7));
el.add(new Integer(93));
assertEquals(elReplay, el);
assertEquals(selReplay, sel);
assertEquals(felReplay, fel);
assertEquals(relReplay, rel);
if (rel != null) {
rel.addListEventListener(new ListEventListener() {
public void listChanged(final ListEvent listEvent) {
if (listEvent.isChanged()) {
for (int i = listEvent.getIndexStart(); i < listEvent.getIndexEnd();i ++) {
listEvent.getSourceList().get(i);
}
}
}
});
}
el.clear();
assertEquals(elReplay, el);
assertEquals(selReplay, sel);
assertEquals(felReplay, fel);
assertEquals(relReplay, rel);