void () { Double[] doubles = {1.0, 2.0, 3.0, 4.0, 5.0}; CategoryLineChart<Double> chart = LineChart.of(doubles); AtomicInteger counter = new AtomicInteger(); final Consumer<GridLine<Integer, Double, ?>> common = gridline -> { MinMax<Integer, Double> xy = gridline.getXY(); Assert.assertEquals(Integer.valueOf(0), xy.xMin); Assert.assertEquals(Integer.valueOf(4), xy.xMax); Assert.assertEquals(Double.valueOf(1.0), xy.yMin); Assert.assertEquals(Double.valueOf(5.0), xy.yMax); // mutations: xy.setXMin(-1); xy.setXMax(60000); xy.setYMin(-1.0); xy.setYMax(-60000.0); Assert.assertEquals(doubles[counter.getAndIncrement()], gridline.getValue()); }; chart.getGrid().setXPainter(gridline -> { Assert.assertEquals(Integer.valueOf(counter.getAndIncrement()), gridline.getValue()); common.consume(gridline); }); counter.set(0); chart.getGrid().setYPainter(gridline -> { Assert.assertEquals(doubles[counter.getAndIncrement()], gridline.getValue()); common.consume(gridline); }); }