### Question:
StackedXYBarRenderer extends XYBarRenderer { @Override public int hashCode() { int result = super.hashCode(); result = result * 37 + (this.renderAsPercentages ? 1 : 0); return result; } StackedXYBarRenderer();  StackedXYBarRenderer(double margin); boolean getRenderAsPercentages(); void setRenderAsPercentages(boolean asPercentages); @Override int getPassCount(); @Override XYItemRendererState initialise(Graphics2D g2,
                                          Rectangle2D dataArea,
                                          XYPlot plot,
                                          XYDataset data,
                                          PlotRenderingInfo info); @Override Range findRangeBounds(XYDataset dataset); @Override void drawItem(Graphics2D g2,
                         XYItemRendererState state,
                         Rectangle2D dataArea,
                         PlotRenderingInfo info,
                         XYPlot plot,
                         ValueAxis domainAxis,
                         ValueAxis rangeAxis,
                         XYDataset dataset,
                         int series,
                         int item,
                         CrosshairState crosshairState,
                         int pass); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testHashcode() { StackedXYBarRenderer r1 = new StackedXYBarRenderer(); StackedXYBarRenderer r2 = new StackedXYBarRenderer(); assertEquals(r1, r2); int h1 = r1.hashCode(); int h2 = r2.hashCode(); assertEquals(h1, h2); r1.setRenderAsPercentages(true); h1 = r1.hashCode(); h2 = r2.hashCode(); assertFalse(h1 == h2); }