### Question:
GroupedStackedBarRenderer extends StackedBarRenderer implements Cloneable, PublicCloneable, Serializable { @Override public Range findRangeBounds(CategoryDataset dataset) { if (dataset == null) { return null; } Range r = DatasetUtilities.findStackedRangeBounds( dataset, this.seriesToGroupMap); return r; } GroupedStackedBarRenderer(); void setSeriesToGroupMap(KeyToGroupMap map); @Override Range findRangeBounds(CategoryDataset dataset); @Override void drawItem(Graphics2D g2,
                         CategoryItemRendererState state,
                         Rectangle2D dataArea,
                         CategoryPlot plot,
                         CategoryAxis domainAxis,
                         ValueAxis rangeAxis,
                         CategoryDataset dataset,
                         int row,
                         int column,
                         int pass); @Override boolean equals(Object obj);  }### Answer:
@Test public void testFindRangeBounds() { GroupedStackedBarRenderer r = new GroupedStackedBarRenderer(); assertNull(r.findRangeBounds(null)); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); assertNull(r.findRangeBounds(dataset)); dataset.addValue(1.0, "R1", "C1"); assertEquals(new Range(0.0, 1.0), r.findRangeBounds(dataset)); dataset.addValue(-2.0, "R1", "C2"); assertEquals(new Range(-2.0, 1.0), r.findRangeBounds(dataset)); dataset.addValue(null, "R1", "C3"); assertEquals(new Range(-2.0, 1.0), r.findRangeBounds(dataset)); KeyToGroupMap m = new KeyToGroupMap("G1"); m.mapKeyToGroup("R1", "G1"); m.mapKeyToGroup("R2", "G1"); m.mapKeyToGroup("R3", "G2"); r.setSeriesToGroupMap(m); dataset.addValue(0.5, "R3", "C1"); assertEquals(new Range(-2.0, 1.0), r.findRangeBounds(dataset)); dataset.addValue(5.0, "R3", "C2"); assertEquals(new Range(-2.0, 5.0), r.findRangeBounds(dataset)); }