XYSeries s = new XYSeries("S");
s.add(1.0, 11.0);
s.add(2.0, 22.0);
s.add(3.5, 35.0);
s.add(5.0, null);
DefaultXYDataset dataset = new DefaultXYDataset();
dataset.addSeries("S", s.toArray());
assertEquals(1, dataset.getSeriesCount());
assertEquals(4, dataset.getItemCount(0));
assertEquals("S", dataset.getSeriesKey(0));
assertEquals(1.0, dataset.getXValue(0, 0), EPSILON);
assertEquals(2.0, dataset.getXValue(0, 1), EPSILON);
assertEquals(3.5, dataset.getXValue(0, 2), EPSILON);
assertEquals(5.0, dataset.getXValue(0, 3), EPSILON);
assertEquals(11.0, dataset.getYValue(0, 0), EPSILON);
assertEquals(22.0, dataset.getYValue(0, 1), EPSILON);
assertEquals(35.0, dataset.getYValue(0, 2), EPSILON);
assertTrue(Double.isNaN(dataset.getYValue(0, 3)));
}