RowSubset extends AbstractDataSource implements DataListener { public void dataUpdated(DataSource source, DataChangeEvent... events) { dataChanged(source, events); notifyDataUpdated(events); } @SuppressWarnings("unchecked")  RowSubset(DataSource original); @Override Row getRow(int row); Comparable<?> get(int col, int row); @Override int getColumnCount(); int getRowCount(); @Override Class<? extends Comparable<?>>[] getColumnTypes(); void dataAdded(DataSource source, DataChangeEvent... events); void dataUpdated(DataSource source, DataChangeEvent... events); void dataRemoved(DataSource source, DataChangeEvent... events); abstract boolean accept(Row row);  }
@Test public void testDataUpdated() { int sizeBefore = data.getRowCount(); table.set(0, 1, -2); assertEquals(sizeBefore, data.getRowCount()); table.set(0, 1, -3); assertTrue(data.getRowCount() < sizeBefore); table.set(0, 1, -2); table.set(0, 2, -2); assertTrue(data.getRowCount() > sizeBefore); }