@Test
public void drawSeries_withPointLabelFormatter_drawsPointLabels() {

    LineAndPointFormatter formatter =
            new LineAndPointFormatter(0, 0, 0, null);
    formatter.setPointLabelFormatter(new PointLabelFormatter(Color.RED));
    SimpleXYSeries series = new SimpleXYSeries(
            SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "some data", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
    xyPlot.addSeries(series, formatter);
    LineAndPointRenderer renderer = xyPlot.getRenderer(LineAndPointRenderer.class);
    renderer.drawSeries(canvas, plotArea, series, formatter);
    verify(canvas, times(series.size())).drawText(
            anyString(),
            anyFloat(),
            anyFloat(),
            eq(formatter.getPointLabelFormatter().getTextPaint()));
}