FilteredTableModel extends AbstractTableModel { @Override public int getRowCount() { return viewToModel.length; } FilteredTableModel(LogDataTableModel logDataTableModel); @Override int getRowCount(); @Override int getColumnCount(); int convertModelToView(int row); int convertViewToModel(int row); @Override Object getValueAt(int rowIndex, int columnIndex); void addFilter(LogFilter filter); void removeFilter(LogFilter filter); void filterChanged(); String getColumnName(int columnIndex); Class<?> getColumnClass(int columnIndex); boolean isCellEditable(int rowIndex, int columnIndex); void setValueAt(Object aValue, int rowIndex, int columnIndex); void addTableModelListener(TableModelListener l); void removeTableModelListener(TableModelListener l);  }
@Test public void testGetRowCount() { assertEquals(dataTableModel.getRowCount(), filteredTableModel.getRowCount()); TestLogFilterExtension filter = new TestLogFilterExtension("A", "B"); filteredTableModel.addFilter(filter); assertEquals(dataTableModel.getRowCount(), filteredTableModel.getRowCount()); filter.setPassIndex(50); filteredTableModel.doFiltering(); assertEquals(50, filteredTableModel.getRowCount()); }