@Test
public void testNoRenderWithEmptyRange() {

  // Ensures that if the LineChartModel hasn't had a chance to update and the yRange remains zero - then the LineChart would not render
  // any data.
  LineChartModel model = new LineChartModel();
  Range xRange = new Range(0, 10);
  Range yRange = new Range(0, 0);
  DefaultDataSeries<Long> testSeries = new DefaultDataSeries<>();
  for (int i = 0; i < 11; i++) {
    testSeries.add(i, (long)i);
  }
  RangedContinuousSeries rangedSeries = new RangedContinuousSeries("test", xRange, yRange, testSeries);
  model.add(rangedSeries);
  LineChart chart = new LineChart(model);
  chart.setSize(100, 100);
  Graphics2D fakeGraphics = mock(Graphics2D.class);
  when(fakeGraphics.create()).thenReturn(fakeGraphics);
  doThrow(new AssertionError()).when(fakeGraphics).draw(any(Shape.class));
  chart.paint(fakeGraphics);
}