@Test
public void testSetZoomFactor() throws Exception {

    XYSeries rawData = TestUtils.generateXYSeries("my series", 2000);
    SampledXYSeries sampledXYSeries = spy(new SampledXYSeries(rawData, 2, 100));
    sampledXYSeries.setZoomFactor(2);
    assertEquals(1000, sampledXYSeries.size());
    sampledXYSeries.setZoomFactor(4);
    assertEquals(500, sampledXYSeries.size());
    sampledXYSeries.setZoomFactor(8);
    assertEquals(250, sampledXYSeries.size());
    sampledXYSeries.setZoomFactor(16);
    assertEquals(125, sampledXYSeries.size());
}