/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
LegendItemCollection c1 = new LegendItemCollection();
LegendItemCollection c2 = new LegendItemCollection();
assertTrue(c1.equals(c2));
assertTrue(c2.equals(c1));
LegendItem item1 = new LegendItem("Label", "Description",
"ToolTip", "URL", true,
new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0), true, Color.red,
true, Color.blue, new BasicStroke(1.2f), true,
new Line2D.Double(1.0, 2.0, 3.0, 4.0),
new BasicStroke(2.1f), Color.green);
LegendItem item2 = new LegendItem("Label", "Description",
"ToolTip", "URL", true,
new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0),
true, Color.red, true, Color.blue, new BasicStroke(1.2f), true,
new Line2D.Double(1.0, 2.0, 3.0, 4.0), new BasicStroke(2.1f),
Color.green);
c1.add(item1);
assertFalse(c1.equals(c2));
c2.add(item2);
assertTrue(c1.equals(c2));
}