public void guiTestMoveColumn() {
final TableColumn nameColumn = createColumn("name");
EventList<TableColumn> columns = new BasicEventList<TableColumn>();
columns.add(nameColumn);
columns.add(createColumn("age"));
DefaultTableColumnModel defaultModel = watcher.createDefaultModel(columns);
EventTableColumnModel eventModel1 = watcher.createEventModel(columns);
EventTableColumnModel eventModel2 = watcher.createEventModel(GlazedLists.eventList(columns));
assertEquals(eventModel1, defaultModel);
assertEquals(eventModel2, defaultModel);
assertEquals(eventModel1, eventModel2);
assertEquals(3, nameColumn.getPropertyChangeListeners().length);
// move the column at index 0 to index 1
columns.remove(0);
columns.add(nameColumn);
defaultModel.removeColumn(nameColumn);
defaultModel.addColumn(nameColumn);
eventModel2.moveColumn(0, 1);
assertEquals(eventModel1, defaultModel);
assertEquals(eventModel2, defaultModel);
assertEquals(eventModel1, eventModel2);
assertEquals(3, nameColumn.getPropertyChangeListeners().length);
// move the column at index 0 to index 0 (this simulates dragging a column to reorder it)
columns.set(0, columns.get(0));
defaultModel.moveColumn(0, 0);
eventModel2.moveColumn(0, 0);
watcher.assertFiredEventsAgreeAndClear();
}