### Question:
GroupedStackedBarRenderer extends StackedBarRenderer implements Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GroupedStackedBarRenderer)) { return false; } GroupedStackedBarRenderer that = (GroupedStackedBarRenderer) obj; if (!this.seriesToGroupMap.equals(that.seriesToGroupMap)) { return false; } return super.equals(obj); } 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 testEquals() { GroupedStackedBarRenderer r1 = new GroupedStackedBarRenderer(); GroupedStackedBarRenderer r2 = new GroupedStackedBarRenderer(); assertEquals(r1, r2); assertEquals(r2, r1); KeyToGroupMap m1 = new KeyToGroupMap("G1"); m1.mapKeyToGroup("S1", "G2"); r1.setSeriesToGroupMap(m1); assertFalse(r1.equals(r2)); KeyToGroupMap m2 = new KeyToGroupMap("G1"); m2.mapKeyToGroup("S1", "G2"); r2.setSeriesToGroupMap(m2); assertEquals(r1, r2); }