### Question:
ChartCsvGenerator { public String[] generateRow(Chart<Object, Number> chart, int rowNumber) { Preconditions.checkNotNull(chart); Preconditions.checkArgument(rowNumber >= 0); Preconditions.checkArgument(rowNumber < chart.getSeriesList().get(0).getPoints().size()); List<String> row = Lists.newArrayList(); List<Series<Object, Number>> seriesList = chart.getSeriesList(); row.add(pointValueFormatterManager.format(seriesList.get(0).getPoints().get(rowNumber).getX())); for (Series<Object, Number> series : seriesList) { row.add(pointValueFormatterManager.format(series.getPoints().get(rowNumber).getY())); } return row.toArray(new String[row.size()]); }  String[] generateHeader(ChartCode chartCode, AnalysisForm analysisForm, Locale locale); String[] generateRow(Chart<Object, Number> chart, int rowNumber); @Autowired @Qualifier("csvPointValueFormatterManager") void setPointValueFormatterManager(PointValueFormatterManager pointValueFormatterManager); @Autowired void setMessageSource(MessageSource messageSource);  }### Answer:
@Test(expected = NullPointerException.class) public void generateRow_NULL_CHART() { chartCsvGenerator.generateRow(null, 1); }
@Test(expected = IllegalArgumentException.class) public void generateRow_NEGATIVE_ROW_NUMBER() { chartCsvGenerator.generateRow(chart, -1); }
@Test(expected = IllegalArgumentException.class) public void generateRow_TOO_BIG_ROW_NUMBER() { chartCsvGenerator.generateRow(chart, 2); }
@Test public void generateRow() { String[] row = chartCsvGenerator.generateRow(chart, 0); assertEquals(3, row.length); assertEquals("x1", row[0]); assertEquals("1", row[1]); assertEquals("5", row[2]); }