### Question:
CustomCategoryURLGenerator implements CategoryURLGenerator,
        Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CustomCategoryURLGenerator)) { return false; } CustomCategoryURLGenerator generator = (CustomCategoryURLGenerator) obj; int listCount = getListCount(); if (listCount != generator.getListCount()) { return false; } for (int series = 0; series < listCount; series++) { int urlCount = getURLCount(series); if (urlCount != generator.getURLCount(series)) { return false; } for (int item = 0; item < urlCount; item++) { String u1 = getURL(series, item); String u2 = generator.getURL(series, item); if (u1 != null) { if (!u1.equals(u2)) { return false; } } else { if (u2 != null) { return false; } } } } return true; } CustomCategoryURLGenerator(); int getListCount(); int getURLCount(int list); String getURL(int series, int item); @Override String generateURL(CategoryDataset dataset, int series, int item); void addURLSeries(List<String> urls); @Override boolean equals(Object obj); @Override Object clone();  }### Answer:
@Test public void testEquals() { CustomCategoryURLGenerator g1 = new CustomCategoryURLGenerator(); CustomCategoryURLGenerator g2 = new CustomCategoryURLGenerator(); assertEquals(g1, g2); List<String> u1 = new java.util.ArrayList<String>(); u1.add("URL A1"); u1.add("URL A2"); u1.add("URL A3"); g1.addURLSeries(u1); assertFalse(g1.equals(g2)); List<String> u2 = new java.util.ArrayList<String>(); u2.add("URL A1"); u2.add("URL A2"); u2.add("URL A3"); g2.addURLSeries(u2); assertEquals(g1, g2); }