### Question:
XYDrawableAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof XYDrawableAnnotation)) { return false; } XYDrawableAnnotation that = (XYDrawableAnnotation) obj; if (this.x != that.x) { return false; } if (this.y != that.y) { return false; } if (this.displayWidth != that.displayWidth) { return false; } if (this.displayHeight != that.displayHeight) { return false; } if (this.drawScaleFactor != that.drawScaleFactor) { return false; } if (!ObjectUtils.equal(this.drawable, that.drawable)) { return false; } return true; } XYDrawableAnnotation(double x, double y, double width, double height,
                                Drawable drawable);  XYDrawableAnnotation(double x, double y, double displayWidth,
            double displayHeight, double drawScaleFactor, Drawable drawable); @Override void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                     ValueAxis domainAxis, ValueAxis rangeAxis,
                     int rendererIndex,
                     PlotRenderingInfo info); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testEquals() { XYDrawableAnnotation a1 = new XYDrawableAnnotation(10.0, 20.0, 100.0, 200.0, new TestDrawable()); XYDrawableAnnotation a2 = new XYDrawableAnnotation(10.0, 20.0, 100.0, 200.0, new TestDrawable()); assertEquals(a1, a2); a1 = new XYDrawableAnnotation(11.0, 20.0, 100.0, 200.0, new TestDrawable()); assertFalse(a1.equals(a2)); a2 = new XYDrawableAnnotation(11.0, 20.0, 100.0, 200.0, new TestDrawable()); assertEquals(a1, a2); a1 = new XYDrawableAnnotation(11.0, 22.0, 100.0, 200.0, new TestDrawable()); assertFalse(a1.equals(a2)); a2 = new XYDrawableAnnotation(11.0, 22.0, 100.0, 200.0, new TestDrawable()); assertEquals(a1, a2); a1 = new XYDrawableAnnotation(11.0, 22.0, 101.0, 200.0, new TestDrawable()); assertFalse(a1.equals(a2)); a2 = new XYDrawableAnnotation(11.0, 22.0, 101.0, 200.0, new TestDrawable()); assertEquals(a1, a2); a1 = new XYDrawableAnnotation(11.0, 22.0, 101.0, 202.0, new TestDrawable()); assertFalse(a1.equals(a2)); a2 = new XYDrawableAnnotation(11.0, 22.0, 101.0, 202.0, new TestDrawable()); assertEquals(a1, a2); a1 = new XYDrawableAnnotation(11.0, 22.0, 101.0, 202.0, 2.0, new TestDrawable()); assertFalse(a1.equals(a2)); a2 = new XYDrawableAnnotation(11.0, 22.0, 101.0, 202.0, 2.0, new TestDrawable()); assertEquals(a1, a2); }