### Question:
CustomPieURLGenerator implements PieURLGenerator,
        Cloneable, PublicCloneable, Serializable { public void addURLs(Map<Comparable, String> urlMap) { this.urls.add(urlMap); } CustomPieURLGenerator(); @Override String generateURL(PieDataset dataset, Comparable key,
                              int pieIndex); int getListCount(); int getURLCount(int list); String getURL(Comparable key, int mapIndex); void addURLs(Map<Comparable, String> urlMap); @Override boolean equals(Object o); @Override Object clone();  }### Answer:
@Test public void testSerialization() throws IOException, ClassNotFoundException { CustomPieURLGenerator g1 = new CustomPieURLGenerator(); Map<Comparable, String> m1 = new HashMap<Comparable, String>(); m1.put("A", "http: g1.addURLs(m1); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(g1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); CustomPieURLGenerator g2 = (CustomPieURLGenerator) in.readObject(); in.close(); assertEquals(g1, g2); }