SelectedClassAcceptCondition extends SelectionAwareAcceptCondition implements HasIcon { public boolean accept(LogData data) { return classes.contains(data.getClazz()); } SelectedClassAcceptCondition(JTable jTable, LogDataTableModel dataTableModel); boolean accept(LogData data); @Override Icon getIcon();  }
@Test public void testAccept() { SelectedClassAcceptCondition acceptCondition = new SelectedClassAcceptCondition(table, dataTableModel); table.getSelectionModel().addListSelectionListener(acceptCondition); table.getSelectionModel().setSelectionInterval(1, 2); LogData[] logData = dataTableModel.getLogData(); assertFalse(acceptCondition.accept(logData[0])); assertTrue(acceptCondition.accept(logData[1])); assertTrue(acceptCondition.accept(logData[2])); assertFalse(acceptCondition.accept(logData[3])); assertTrue(acceptCondition.accept(logData[4])); }