DataTable extends AbstractDataSource implements MutableDataSource { public void remove(int row) { DataChangeEvent[] events; synchronized (rows) { Row r = new Row(this, row); events = new DataChangeEvent[getColumnCount()]; for (int col = 0; col < events.length; col++) { events[col] = new DataChangeEvent(this, col, row, r.get(col), null); } rows.remove(row); } 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 testRemove() { int sizeBefore = table.getRowCount(); table.remove(0); assertEquals(sizeBefore - 1, table.getRowCount()); try { table.remove(-1); fail("Expected IndexOutOfBoundsException exception."); } catch (IndexOutOfBoundsException e) { } try { table.remove(table.getRowCount()); fail("Expected IndexOutOfBoundsException exception."); } catch (IndexOutOfBoundsException e) { } }