ListSortUI { public void modelChanged(ListDataEvent e) { ModelChange change = new ModelChange(e); prepareForChange(change); notifySorter(change); if (change.type != ListDataEvent.CONTENTS_CHANGED) { sorterChanged = true; } processChange(change); } ListSortUI(JXList list, RowSorter<? extends ListModel> sorter); void dispose(); void modelChanged(ListDataEvent e); void viewSelectionChanged(ListSelectionEvent e);  }
@Test public void testModelChanged() { int first = 3; int last = 5; ListDataEvent e = new ListDataEvent(new DefaultListModel(), ListDataEvent.CONTENTS_CHANGED, last, first); ModelChange change = new ModelChange(e); assertEquals(ListDataEvent.CONTENTS_CHANGED, change.type); assertFalse(change.allRowsChanged); assertEquals(last-first +1, change.length); assertEquals(first, change.startModelIndex); assertEquals(last, change.endModelIndex); }