### Question:
TableCategoryDatasetBuilder implements TableDatasetBuilder { @Override public Dataset getDataset() { return dataset; }  @Override void setNumberOfRows(int numberOfRows); @Override void setNumberOfColumns(int numberOfColumns); @Override void setTranspose(boolean transpose); @Override void setColumnHeading(int columnIndex, String heading); @Override void setRowHeading(int rowIndex, String heading); @Override void setValue(int rowIndex, int columnIndex, Number value); @Override Dataset getDataset(); @Override void setParameters(Map<String, String> parameters); @Override boolean forceColumnHeadings(); @Override boolean forceRowHeadings(); @Override void setLocaleConfiguration(LocaleConfiguration localeConfiguration);  }### Answer:
@Test public void testBuildCategoryDataset() throws Exception { String content = "| column 1 | column 2 | column 3 | column 4\n" + "| row 1 | 12 | 13 | 14 \n" + "| row 2 | 22 | 23 | 24 \n"; setUpContentExpectation(content); getDataSource().buildDataset(content, map("type", "line", "range", "B2-D3"), null); ChartModel chartModel = getDataSource().getChartModel(); Dataset dataset = chartModel.getDataset(); Assert.assertTrue(dataset instanceof CategoryDataset); Assert.assertTrue(chartModel.getAxis(0) instanceof CategoryAxis); Assert.assertTrue(chartModel.getAxis(1) instanceof ValueAxis); CategoryDataset categoryDataset = (CategoryDataset) dataset; Assert.assertTrue(categoryDataset.getRowKey(0).equals(" row 1 ")); Assert.assertTrue(categoryDataset.getRowKey(1).equals(" row 2 ")); Assert.assertTrue(categoryDataset.getColumnKey(0).equals(" column 2 ")); Assert.assertTrue(categoryDataset.getColumnKey(1).equals(" column 3 ")); Assert.assertTrue(categoryDataset.getColumnKey(2).equals(" column 4")); Assert.assertTrue(categoryDataset.getValue(0, 0).intValue() == 12); Assert.assertTrue(categoryDataset.getValue(0, 1).intValue() == 13); Assert.assertTrue(categoryDataset.getValue(0, 2).intValue() == 14); Assert.assertTrue(categoryDataset.getValue(1, 0).intValue() == 22); Assert.assertTrue(categoryDataset.getValue(1, 1).intValue() == 23); Assert.assertTrue(categoryDataset.getValue(1, 2).intValue() == 24); }
@Test public void testBuildCategoryDatasetColumnsSeries() throws Exception { String content = "| column 1 | column 2 | column 3 | column 4\n" + "| row 1 | 12 | 13 | 14 \n" + "| row 2 | 22 | 23 | 24 \n"; setUpContentExpectation(content); getDataSource().buildDataset(content, map("type", "line", "range", "B2-D3", "series", "columns"), null); ChartModel chartModel = getDataSource().getChartModel(); Dataset dataset = chartModel.getDataset(); Assert.assertTrue(dataset instanceof CategoryDataset); Assert.assertTrue(chartModel.getAxis(0) instanceof CategoryAxis); Assert.assertTrue(chartModel.getAxis(1) instanceof ValueAxis); CategoryDataset categoryDataset = (CategoryDataset) dataset; Assert.assertTrue(categoryDataset.getColumnKey(0).equals(" row 1 ")); Assert.assertTrue(categoryDataset.getColumnKey(1).equals(" row 2 ")); Assert.assertTrue(categoryDataset.getRowKey(0).equals(" column 2 ")); Assert.assertTrue(categoryDataset.getRowKey(1).equals(" column 3 ")); Assert.assertTrue(categoryDataset.getRowKey(2).equals(" column 4")); Assert.assertTrue(categoryDataset.getValue(0, 0).intValue() == 12); Assert.assertTrue(categoryDataset.getValue(1, 0).intValue() == 13); Assert.assertTrue(categoryDataset.getValue(2, 0).intValue() == 14); Assert.assertTrue(categoryDataset.getValue(0, 1).intValue() == 22); Assert.assertTrue(categoryDataset.getValue(1, 1).intValue() == 23); Assert.assertTrue(categoryDataset.getValue(2, 1).intValue() == 24); }