### Question:
ColumnDefinitionTableBinder implements Observer, ListSelectionListener { @Override public void update(Observable o, Object arg) { if (ColumnDefinitionModel.SELECTED_DEFINITION_PROPERTY.equals(arg)) { int currentSelection = myTable.getSelectionModel().getAnchorSelectionIndex(); ColumnDefinitionRow selectedRow = myModel.getSelectedDefinition(); if (selectedRow != null && (currentSelection < 0 || selectedRow.getColumnId() != currentSelection)) { myTable.getSelectionModel().setSelectionInterval(selectedRow.getColumnId(), selectedRow.getColumnId()); } else if (selectedRow == null && currentSelection >= 0) { myTable.getSelectionModel().clearSelection(); myTable.getSelectionModel().setAnchorSelectionIndex(-1); } } } ColumnDefinitionTableBinder(JTable definitionTable, ColumnDefinitionModel model); void close(); @Override void update(Observable o, Object arg); @Override void valueChanged(ListSelectionEvent e);  }### Answer:
@SuppressWarnings("unused") @Test public void testUpdate() { ColumnDefinitionModel model = createModel(); JTable table = createTestTable(model.getDefinitionTableModel()); ColumnDefinitionTableBinder binder = new ColumnDefinitionTableBinder(table, model); model.setSelectedDefinition(model.getDefinitionTableModel().getRow(0)); assertEquals(0, table.getSelectionModel().getMinSelectionIndex()); model.setSelectedDefinition(model.getDefinitionTableModel().getRow(0)); assertEquals(0, table.getSelectionModel().getMinSelectionIndex()); }