/**
* Serialize an instance, restore it, and check for equality.
*/
public void testSerialization() {
LegendItemCollection c1 = new LegendItemCollection();
c1.add(new LegendItem("Item", "Description", "ToolTip", "URL",
new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0), Color.red));
LegendItemCollection c2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(c1);
out.close();