### Question:
XYErrorRenderer extends XYLineAndShapeRenderer { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYErrorRenderer)) { return false; } XYErrorRenderer that = (XYErrorRenderer) obj; if (this.drawXError != that.drawXError) { return false; } if (this.drawYError != that.drawYError) { return false; } if (this.capLength != that.capLength) { return false; } if (!PaintUtilities.equal(this.errorPaint, that.errorPaint)) { return false; } if (!ObjectUtilities.equal(this.errorStroke, that.errorStroke)) { return false; } return super.equals(obj); } XYErrorRenderer(); boolean getDrawXError(); void setDrawXError(boolean draw); boolean getDrawYError(); void setDrawYError(boolean draw); double getCapLength(); void setCapLength(double length); Paint getErrorPaint(); void setErrorPaint(Paint paint); Stroke getErrorStroke(); void setErrorStroke(Stroke stroke); @Override Range findDomainBounds(XYDataset dataset); @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);  }### Answer:
@Test public void testEquals() { XYErrorRenderer r1 = new XYErrorRenderer(); XYErrorRenderer r2 = new XYErrorRenderer(); assertEquals(r1, r2); r1.setDrawXError(false); assertFalse(r1.equals(r2)); r2.setDrawXError(false); assertEquals(r1, r2); r1.setDrawYError(false); assertFalse(r1.equals(r2)); r2.setDrawYError(false); assertEquals(r1, r2); r1.setCapLength(9.0); assertFalse(r1.equals(r2)); r2.setCapLength(9.0); assertEquals(r1, r2); r1.setErrorPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.green)); assertFalse(r1.equals(r2)); r2.setErrorPaint(new GradientPaint(1.0f, 2.0f, Color.RED, 3.0f, 4.0f, Color.green)); assertEquals(r1, r2); r1.setErrorStroke(new BasicStroke(1.5f)); assertFalse(r1.equals(r2)); r2.setErrorStroke(new BasicStroke(1.5f)); assertEquals(r1, r2); }