@Test public void testEquals() { CustomPieURLGenerator g1 = new CustomPieURLGenerator(); CustomPieURLGenerator g2 = new CustomPieURLGenerator(); assertEquals(g1, g2); Map<Comparable, String> m1 = new HashMap<Comparable, String>(); m1.put("A", "http: g1.addURLs(m1); assertFalse(g1.equals(g2)); g2.addURLs(m1); assertEquals(g1, g2); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof CustomPieURLGenerator) { CustomPieURLGenerator generator = (CustomPieURLGenerator) o; if (getListCount() != generator.getListCount()) { return false; } for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; } Set<Comparable> keySet = this.urls.get(pieItem).keySet(); for (Comparable key : keySet) { if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false; } } } return true; } return false; }
CustomPieURLGenerator implements PieURLGenerator,
        Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof CustomPieURLGenerator) { CustomPieURLGenerator generator = (CustomPieURLGenerator) o; if (getListCount() != generator.getListCount()) { return false; } for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; } Set<Comparable> keySet = this.urls.get(pieItem).keySet(); for (Comparable key : keySet) { if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false; } } } return true; } return false; } }
CustomPieURLGenerator implements PieURLGenerator,
        Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof CustomPieURLGenerator) { CustomPieURLGenerator generator = (CustomPieURLGenerator) o; if (getListCount() != generator.getListCount()) { return false; } for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; } Set<Comparable> keySet = this.urls.get(pieItem).keySet(); for (Comparable key : keySet) { if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false; } } } return true; } return false; } CustomPieURLGenerator(); }
CustomPieURLGenerator implements PieURLGenerator,
        Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof CustomPieURLGenerator) { CustomPieURLGenerator generator = (CustomPieURLGenerator) o; if (getListCount() != generator.getListCount()) { return false; } for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; } Set<Comparable> keySet = this.urls.get(pieItem).keySet(); for (Comparable key : keySet) { if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false; } } } return true; } return false; } 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(); }
CustomPieURLGenerator implements PieURLGenerator,
        Cloneable, PublicCloneable, Serializable { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof CustomPieURLGenerator) { CustomPieURLGenerator generator = (CustomPieURLGenerator) o; if (getListCount() != generator.getListCount()) { return false; } for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; } Set<Comparable> keySet = this.urls.get(pieItem).keySet(); for (Comparable key : keySet) { if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false; } } } return true; } return false; } 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();  }