### Question:
ImportValidator { public String validate() { String message = null; ColumnDefinitionTableModel tableModel = myModel.getDefinitionTableModel(); boolean hasImport = false; for (int i = 0; i < tableModel.getRowCount(); i++) { ColumnDefinitionRow column = tableModel.getRow(i); if (column.isImport()) { hasImport = true; break; } } if (!hasImport) { message = "Must have at least one column selected for import."; } return message; } ImportValidator(ColumnDefinitionModel model); String validate();  }### Answer:
@Test public void testValidate() { ColumnDefinitionModel model = new ColumnDefinitionModel(); ColumnDefinitionRow row1 = new ColumnDefinitionRow(); row1.setIsImport(true); ColumnDefinitionRow row2 = new ColumnDefinitionRow(); row2.setIsImport(true); model.getDefinitionTableModel().addRows(New.list(row1, row2)); ImportValidator validator = new ImportValidator(model); assertNull(validator.validate()); row2.setIsImport(false); assertNull(validator.validate()); row1.setIsImport(false); assertNotNull(validator.validate()); }