CsvExporter { public void clear() { for (int i = 0; i < dataRows; i++) { dt.row(i + 1).clear(); } dataRows = 0; } CsvExporter(int numCols, String... headers); void addRow(List<?> data); void addRow(Object... data); void clear(); String export();  }
@Test public void clear() { exporter = new CsvExporter(2, "foo", "bar"); exporter.addRow("hello", "world"); assertEquals("hello", exporter.getTable().get(1, 0)); assertEquals("world", exporter.getTable().get(1, 1)); exporter.clear(); assertNull(exporter.getTable().get(1, 0)); assertNull(exporter.getTable().get(1, 1)); assertTrue(exporter.getTable().row(1).isEmpty()); assertEquals(1, exporter.getTable().rowKeySet().size()); }