@Test
public void testOnRender_withPointLabeler() throws Exception {

    BubbleFormatter formatter = spy(new BubbleFormatter());
    PointLabelFormatter plf = new PointLabelFormatter(Color.MAGENTA);
    formatter.setPointLabelFormatter(plf);
    BubbleRenderer br = formatter.getRendererInstance(xyPlot);
    BubbleRenderer renderer = spy(br);
    doReturn(renderer.getClass()).when(formatter).getRendererClass();
    doReturn(renderer).when(formatter).getRendererInstance(any(XYPlot.class));
    BubbleSeries bs = new BubbleSeries(2, 2, 22);
    xyPlot.addSeries(bs, formatter);
    renderer.onRender(canvas, plotArea, bs, formatter, renderStack);
    // verify the z-val is the one labeled:
    verify(canvas).drawText(eq("22"), anyFloat(), anyFloat(), eq(plf.getTextPaint()));
}