assertEquals(l, bel);
}
public void testOtherListEventIsResourced() {
final EventList el = new AbstractEventList() {
public Object get(final int index) {
fireListEvent(ListEvent.createOther(this));
return null;
}
public int size() {
return 0;
}
};
final EventList bel = createBackedEventList(el);
final ListEventListener lel = new ListEventListener() {
private int count = 0;
public void listChanged(final ListEvent listEvent) {
switch (count++) {
case 0:
assertEquals(ListEvent.createOther(bel), listEvent);
break;
case 1:
assertNull(listEvent);
break;
default:
fail("Unexpected: " + listEvent);
}
}
};
bel.addListEventListener(lel);
el.get(0);
lel.listChanged(null);
bel.removeListEventListener(lel);
}