public void testRemove() throws Exception { String element = "1"; list.add(element); assertEquals(1, bean.getList().size()); list.remove(element); assertEquals(0, bean.getList().size()); }
public void testRemoveAtIndexListChangeEvent() throws Exception { String element = "1"; list.add(element); assertEquals(1, list.size()); ListChangeEventTracker listener = new ListChangeEventTracker(); list.addListChangeListener(listener); list.remove(0); assertEquals(1, listener.count); ListChangeEvent event = listener.event; assertSame(list, event.getObservableList()); assertDiff(event.diff, Collections.singletonList(element), Collections.EMPTY_LIST); }