PathAttributeConfigurationImpl implements PathAttributeConfiguration { @Override public boolean equals(Object obj) { if(!(obj instanceof PathAttributeConfiguration)) return false; return (compareTo((PathAttributeConfiguration)obj) == 0); } PathAttributeConfigurationImpl();   PathAttributeConfigurationImpl(Collection<PathAttribute> attributes); @Override Set<PathAttribute> getAttributes(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(PathAttributeConfiguration o);  }
@Test public void testEquals() { PathAttributeConfiguration a = new PathAttributeConfigurationImpl(); PathAttributeConfiguration b = new PathAttributeConfigurationImpl(); PathAttributeConfiguration c = new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(100))); PathAttributeConfiguration d = new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(100))); PathAttributeConfiguration e = new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(100), (PathAttribute)new MultiExitDiscPathAttribute(10))); PathAttributeConfiguration f = new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new MultiExitDiscPathAttribute(10), (PathAttribute)new LocalPrefPathAttribute(100))); Assert.assertTrue(a.equals(b)); Assert.assertTrue(c.equals(d)); Assert.assertTrue(e.equals(f)); Assert.assertFalse(a.equals(c)); Assert.assertFalse(a.equals(e)); Assert.assertFalse(c.equals(e)); }