@Test
public void testOnRender() throws Exception {

    CandlestickFormatter formatter = spy(new CandlestickFormatter());
    CandlestickRenderer renderer = spy((CandlestickRenderer) formatter.doGetRendererInstance(xyPlot));
    doReturn(renderer.getClass()).when(formatter).getRendererClass();
    doReturn(renderer).when(formatter).doGetRendererInstance(any(XYPlot.class));
    XYSeries openVals = new SimpleXYSeries(SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "open", 1, 2, 3, 4);
    XYSeries closeVals = new SimpleXYSeries(SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "open", 1, 2, 3, 4);
    XYSeries highVals = new SimpleXYSeries(SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "open", 1, 2, 3, 4);
    XYSeries lowVals = new SimpleXYSeries(SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "open", 1, 2, 3, 4);
    CandlestickMaker.make(xyPlot, formatter, openVals, closeVals, highVals, lowVals);
    renderer.onRender(canvas, plotArea, openVals, formatter, renderStack);
}