### Question:
ColumnDefinitionController extends BaseSelectedColumnObserver { private void applyChanges() { ColumnDefinitionTableModel columnTable = myModel.getDefinitionTableModel(); CSVParseParameters parameters = myModel.getSelectedParameters(); List<String> columnNames = New.list(); List<SpecialColumn> specialColumns = New.list(); List<Integer> ignoreColumns = New.list(); for (int i = 0; i < columnTable.getRowCount(); i++) { ColumnDefinitionRow row = columnTable.getRow(i); columnNames.add(row.getColumnName()); String dataType = row.getDataType(); if (StringUtils.isNotEmpty(dataType)) { SpecialColumn specialColumn = new SpecialColumn(); specialColumn.setColumnIndex(row.getColumnId()); specialColumn.setColumnType(ColumnType.fromString(dataType)); specialColumn.setFormat(row.getFormat()); specialColumns.add(specialColumn); } if (!row.isImport()) { ignoreColumns.add(Integer.valueOf(row.getColumnId())); } } parameters.setColumnNames(columnNames); parameters.getSpecialColumns().clear(); parameters.getSpecialColumns().addAll(specialColumns); parameters.setColumnsToIgnore(ignoreColumns); } ColumnDefinitionController(PreferencesRegistry preferencesRegistry, ColumnDefinitionModel model, CellSampler sampler); @Override void close(); void setAllColumnsImport(boolean imp); @Override void update(Observable o, Object arg);  }### Answer:
@Test public void testApplyChanges() { EasyMockSupport support = new EasyMockSupport(); PreferencesRegistry registry = createPreferencesRegistry(support); CellSampler sampler = createSampler(support); ColumnDefinitionModel model = createModel(); support.replayAll(); @SuppressWarnings("unused") ColumnDefinitionController controller = new ColumnDefinitionController(registry, model, sampler); ColumnDefinitionTableModel definitionTable = model.getDefinitionTableModel(); CSVParseParameters parameters = model.getSelectedParameters(); ColumnDefinitionRow timeRow = definitionTable.getRow(0); model.setSelectedDefinition(timeRow); timeRow.setFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); SpecialColumn timeColumn = parameters.getSpecialColumn(ColumnType.TIMESTAMP); assertEquals(0, timeColumn.getColumnIndex()); assertEquals("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timeColumn.getFormat()); ColumnDefinitionRow latRow = definitionTable.getRow(1); model.setSelectedDefinition(latRow); latRow.setDataType(null); assertEquals(2, parameters.getSpecialColumns().size()); ColumnDefinitionRow lonRow = definitionTable.getRow(2); model.setSelectedDefinition(lonRow); lonRow.setColumnName("Longitude"); List<? extends String> columnNames = parameters.getColumnNames(); assertEquals("Longitude", columnNames.get(2)); ColumnDefinitionRow name2 = definitionTable.getRow(4); model.setSelectedDefinition(name2); name2.setIsImport(true); columnNames = parameters.getColumnNames(); assertEquals(ColumnHeaders.TIME.toString(), columnNames.get(0)); assertEquals(ColumnHeaders.LAT.toString(), columnNames.get(1)); assertEquals("Longitude", columnNames.get(2)); assertEquals(ColumnHeaders.NAME.toString(), columnNames.get(3)); assertEquals(ColumnHeaders.NAME2.toString(), columnNames.get(4)); assertEquals(2, parameters.getSpecialColumns().size()); timeColumn = parameters.getSpecialColumn(ColumnType.TIMESTAMP); assertEquals(0, timeColumn.getColumnIndex()); assertEquals("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timeColumn.getFormat()); SpecialColumn lonColumn = parameters.getSpecialColumn(ColumnType.LON); assertEquals(2, lonColumn.getColumnIndex()); assertEquals("Decimal", lonColumn.getFormat()); assertTrue(parameters.getColumnsToIgnore().isEmpty()); support.verifyAll(); }