### Question:
XYPolygonAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public int hashCode() { int result = 193; result = 37 * result + HashUtilities.hashCodeForDoubleArray( this.polygon); result = 37 * result + HashUtilities.hashCodeForPaint(this.fillPaint); result = 37 * result + HashUtilities.hashCodeForPaint( this.outlinePaint); if (this.stroke != null) { result = 37 * result + this.stroke.hashCode(); } return result; } XYPolygonAnnotation(double[] polygon);  XYPolygonAnnotation(double[] polygon,
                               Stroke stroke, Paint outlinePaint);  XYPolygonAnnotation(double[] polygon,
                               Stroke stroke,
                               Paint outlinePaint, Paint fillPaint); double[] getPolygonCoordinates(); Paint getFillPaint(); Stroke getOutlineStroke(); Paint getOutlinePaint(); @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 testHashCode() { Stroke stroke = new BasicStroke(2.0f); XYPolygonAnnotation a1 = new XYPolygonAnnotation(new double[] {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}, stroke, Color.RED, Color.BLUE); XYPolygonAnnotation a2 = new XYPolygonAnnotation(new double[] {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}, stroke, Color.RED, Color.BLUE); assertEquals(a1, a2); int h1 = a1.hashCode(); int h2 = a2.hashCode(); assertEquals(h1, h2); }