### Question:
XYTextAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public int hashCode() { int result = 193; result = 37 * this.text.hashCode(); result = 37 * this.font.hashCode(); result = 37 * result + HashUtilities.hashCodeForPaint(this.paint); long temp = Double.doubleToLongBits(this.x); result = 37 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(this.y); result = 37 * result + (int) (temp ^ (temp >>> 32)); result = 37 * result + this.textAnchor.hashCode(); result = 37 * result + this.rotationAnchor.hashCode(); temp = Double.doubleToLongBits(this.rotationAngle); result = 37 * result + (int) (temp ^ (temp >>> 32)); return result; } XYTextAnnotation(String text, double x, double y); String getText(); void setText(String text); Font getFont(); void setFont(Font font); Paint getPaint(); void setPaint(Paint paint); TextAnchor getTextAnchor(); void setTextAnchor(TextAnchor anchor); TextAnchor getRotationAnchor(); void setRotationAnchor(TextAnchor anchor); double getRotationAngle(); void setRotationAngle(double angle); double getX(); void setX(double x); double getY(); void setY(double y); Paint getBackgroundPaint(); void setBackgroundPaint(Paint paint); Paint getOutlinePaint(); void setOutlinePaint(Paint paint); Stroke getOutlineStroke(); void setOutlineStroke(Stroke stroke); boolean isOutlineVisible(); void setOutlineVisible(boolean visible); @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(); static final Font DEFAULT_FONT; static final Paint DEFAULT_PAINT; static final TextAnchor DEFAULT_TEXT_ANCHOR; static final TextAnchor DEFAULT_ROTATION_ANCHOR; static final double DEFAULT_ROTATION_ANGLE; }### Answer:
@Test public void testHashCode() { XYTextAnnotation a1 = new XYTextAnnotation("Text", 10.0, 20.0); XYTextAnnotation a2 = new XYTextAnnotation("Text", 10.0, 20.0); assertEquals(a1, a2); int h1 = a1.hashCode(); int h2 = a2.hashCode(); assertEquals(h1, h2); }