### Question:
XYTextAnnotation extends AbstractXYAnnotation implements Cloneable, PublicCloneable, Serializable { @Override public Object clone() throws CloneNotSupportedException { return super.clone(); } 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 testCloning() throws CloneNotSupportedException { XYTextAnnotation a1 = new XYTextAnnotation("Text", 10.0, 20.0); XYTextAnnotation a2 = (XYTextAnnotation) a1.clone(); assertNotSame(a1, a2); assertSame(a1.getClass(), a2.getClass()); assertEquals(a1, a2); }