ExternalComponentDisplayer extends AbstractErraiDisplayer<ExternalComponentDisplayer.View> { public String[][] buildData(DataSet ds) { List<DataColumn> columns = ds.getColumns(); int rows = columns.get(0).getValues().size(); int cols = columns.size(); String[][] result = new String[rows][]; for (int i = 0; i < rows; i++) { String[] line = new String[cols]; for (int j = 0; j < cols; j++) { line[j] = columnValueToString(ds.getValueAt(i, j)); } result[i] = line; } return result; }  @Override View getView(); @PostConstruct void init(); @Override DisplayerConstraints createDisplayerConstraints(); ExternalComponentPresenter getExternalComponentPresenter(); String[][] buildData(DataSet ds);  }
@Test public void testBuildData() throws ParseException { DataSet dataSet = ExpenseReportsData.INSTANCE.toDataSet(); ExternalComponentDisplayer displayer = new ExternalComponentDisplayer(); String[][] buildData = displayer.buildData(dataSet); for (int i = 0; i < buildData.length; i++) { for (int j = 0; j < buildData[i].length; j++) { assertEquals(buildData[i][j], dataSet.getValueAt(i, j).toString()); } } }