HigherIdAcceptCondition extends SelectionAwareAcceptCondition { @Override public boolean accept(LogData data) { return data.getId() > id; } HigherIdAcceptCondition(JTable jTable, LogDataTableModel dataTableModel); @Override boolean accept(LogData data);  }
@Test public void testAccept() { HigherIdAcceptCondition acceptCondition = new HigherIdAcceptCondition(table, dataTableModel); table.getSelectionModel().addListSelectionListener(acceptCondition); table.getSelectionModel().setSelectionInterval(3, 3); LogData[] logData = dataTableModel.getLogData(); for (LogData logData2 : logData) { if (logData2.getId() > 3) { assertTrue(acceptCondition.accept(logData2)); } else { assertFalse(acceptCondition.accept(logData2)); } } }