DataTable extends AbstractDataSource implements MutableDataSource { public void clear() { DataChangeEvent[] events; synchronized (this) { int cols = getColumnCount(); int rows = getRowCount(); events = new DataChangeEvent[cols*rows]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { events[col + row*cols] = new DataChangeEvent( this, col, row, get(col, row), null); } } this.rows.clear(); } notifyDataRemoved(events); } DataTable();  DataTable(Class<? extends Comparable<?>>... types); @SuppressWarnings("unchecked")  DataTable(int cols, Class<? extends Comparable<?>> type);  DataTable(DataSource source);  DataTable(Column... columns); int add(Comparable<?>... values); int add(List<? extends Comparable<?>> values); int add(Row row); void add(Record row); void remove(int row); void removeLast(); void clear(); Comparable<?> get(int col, int row); @SuppressWarnings("unchecked") Comparable<T> set(int col, int row, Comparable<T> value); int getRowCount(); void sort(final DataComparator... comparators); @Override void setName(String name);  }
@Test public void testClear() { table.clear(); assertEquals(0, table.getRowCount()); }