@Test
public void testFindZBounds() {
XYShapeRenderer r = new XYShapeRenderer();
assertNull(r.findZBounds(null));
DefaultXYZDataset dataset = new DefaultXYZDataset();
Range range;
double data1[][] = { {1,1,1}, {1,1,1}, {1,2,3} };
dataset.addSeries("series1", data1);
range = r.findZBounds(dataset);
assertNotNull(range);
assertEquals(1d, range.getLowerBound(), EPSILON);
assertEquals(3d, range.getUpperBound(), EPSILON);
double data2[][] = { {1,1,1}, {1,1,1}, {-1,-2,-3} };
dataset.removeSeries("series1");
dataset.addSeries("series2", data2);
range = r.findZBounds(dataset);
assertNotNull(range);
assertEquals(-3d, range.getLowerBound(), EPSILON);
assertEquals(-1d, range.getUpperBound(), EPSILON);
double data3[][] = { {1,1,1}, {1,1,1}, {-1.2,2.9,3.8} };
dataset.removeSeries("series2");
dataset.addSeries("series3", data3);
range = r.findZBounds(dataset);
assertNotNull(range);
assertEquals(-1.2d, range.getLowerBound(), EPSILON);
assertEquals(3.8d, range.getUpperBound(), EPSILON);
}