/**
* Confirm that cloning works.
*/
public void testCloning() {
XYBoxAnnotation a1 = new XYBoxAnnotation(
1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
);
XYBoxAnnotation a2 = null;
try {
a2 = (XYBoxAnnotation) a1.clone();
}
catch (CloneNotSupportedException e) {
System.err.println("Failed to clone.");
}
assertTrue(a1 != a2);
assertTrue(a1.getClass() == a2.getClass());
assertTrue(a1.equals(a2));
}