/**
* Confirm that cloning works.
*/
public void testCloning() {
XYPlot plot = new XYPlot();
LegendTitle t1 = new LegendTitle(plot);
t1.setBackgroundPaint(
new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)
);
LegendTitle t2 = null;
try {
t2 = (LegendTitle) t1.clone();
}
catch (CloneNotSupportedException e) {
System.err.println("Failed to clone.");
}
assertTrue(t1 != t2);
assertTrue(t1.getClass() == t2.getClass());
assertTrue(t1.equals(t2));
}