void () { XYLineDataset<Double, Double> maxValuesDataset = new XYLineDataset<>(); maxValuesDataset.setLabel("MAX VALUES"); XYLineDataset<Double, Double> minValuesDataset = new XYLineDataset<>(); minValuesDataset.setLabel("MIN VALUES"); XYLineChart<Double, Double> chart = LineChart.of(maxValuesDataset, minValuesDataset); Assert.assertFalse(chart.getDataset("MAX VALUES").getData().iterator().hasNext()); Assert.assertFalse(chart.getDataset("MIN VALUES").getData().iterator().hasNext()); for (int i = 1; i < 1000; i++) { chart.getDataset("MAX VALUES").add(Coordinates.of( Double.valueOf(i), Double.valueOf(i))); Assert.assertEquals(i, ((List<?>) chart.getDataset("MAX VALUES").getData()).size()); Assert.assertFalse(chart.getDataset("MIN VALUES").getData().iterator().hasNext()); } }