SelectedThreadAcceptCondition extends SelectionAwareAcceptCondition { @Override public boolean accept(LogData data) { return threads.contains(data.getThread()); } SelectedThreadAcceptCondition(JTable jTable, LogDataTableModel dataTableModel); @Override boolean accept(LogData data);  }
@Test public void testAccept() { SelectedThreadAcceptCondition acceptCondition = new SelectedThreadAcceptCondition(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])); }