AddressFamilyRoutingPeerConfigurationImpl implements AddressFamilyRoutingPeerConfiguration { @Override public boolean equals(Object obj) { if(!(obj instanceof AddressFamilyRoutingPeerConfiguration)) return false; AddressFamilyRoutingPeerConfiguration o = (AddressFamilyRoutingPeerConfiguration)obj; EqualsBuilder builder = (new EqualsBuilder()) .append(getAddressFamilyKey(), o.getAddressFamilyKey()) .append(getLocalDefaultPathAttributes(), o.getLocalDefaultPathAttributes()) .append(getRemoteDefaultPathAttributes(), o.getRemoteDefaultPathAttributes()) .append(getLocalRoutingFilters(), o.getLocalRoutingFilters()) .append(getRemoteRoutingFilters(), o.getRemoteRoutingFilters()); if(builder.isEquals()) { Iterator<RoutingFilterConfiguration> lit = getLocalRoutingFilters().iterator(); Iterator<RoutingFilterConfiguration> rit = o.getLocalRoutingFilters().iterator(); while(lit.hasNext()) builder.append(lit.next(), rit.next()); } if(builder.isEquals()) { Iterator<RoutingFilterConfiguration> lit = getRemoteRoutingFilters().iterator(); Iterator<RoutingFilterConfiguration> rit = o.getRemoteRoutingFilters().iterator(); while(lit.hasNext()) builder.append(lit.next(), rit.next()); } return builder.isEquals(); } AddressFamilyRoutingPeerConfigurationImpl();   AddressFamilyRoutingPeerConfigurationImpl(AddressFamilyKey addressFamilyKey, 
			Collection<RoutingFilterConfiguration> localRoutingFilters,
			Collection<RoutingFilterConfiguration> remoteRoutingFilters, 
			PathAttributeConfiguration localDefaultPathAttributes,
			PathAttributeConfiguration remoteDefaultPathAttributes); @Override AddressFamilyKey getAddressFamilyKey(); @Override Set<RoutingFilterConfiguration> getLocalRoutingFilters(); @Override Set<RoutingFilterConfiguration> getRemoteRoutingFilters(); @Override PathAttributeConfiguration getLocalDefaultPathAttributes(); @Override PathAttributeConfiguration getRemoteDefaultPathAttributes(); @Override int compareTo(AddressFamilyRoutingPeerConfiguration o); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { AddressFamilyRoutingPeerConfiguration a = new AddressFamilyRoutingPeerConfigurationImpl(AddressFamilyKey.IPV4_UNICAST_FORWARDING, Arrays.asList((RoutingFilterConfiguration)new PrefixRoutingFilterConfigurationImpl("foo", Arrays.asList(new NetworkLayerReachabilityInformation(24, new byte[] {(byte)0xc0, (byte)0xa8, 0x01})))), Arrays.asList((RoutingFilterConfiguration)new PrefixRoutingFilterConfigurationImpl("foo", Arrays.asList(new NetworkLayerReachabilityInformation(24, new byte[] {(byte)0xc0, (byte)0xa8, 0x02})))), new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(100), (PathAttribute)new MultiExitDiscPathAttribute(1))), new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(200), (PathAttribute)new MultiExitDiscPathAttribute(2)))); AddressFamilyRoutingPeerConfiguration b = new AddressFamilyRoutingPeerConfigurationImpl(AddressFamilyKey.IPV4_UNICAST_FORWARDING, Arrays.asList((RoutingFilterConfiguration)new PrefixRoutingFilterConfigurationImpl("foo", Arrays.asList(new NetworkLayerReachabilityInformation(24, new byte[] {(byte)0xc0, (byte)0xa8, 0x01})))), Arrays.asList((RoutingFilterConfiguration)new PrefixRoutingFilterConfigurationImpl("foo", Arrays.asList(new NetworkLayerReachabilityInformation(24, new byte[] {(byte)0xc0, (byte)0xa8, 0x02})))), new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(100), (PathAttribute)new MultiExitDiscPathAttribute(1))), new PathAttributeConfigurationImpl(Arrays.asList((PathAttribute)new LocalPrefPathAttribute(200), (PathAttribute)new MultiExitDiscPathAttribute(2)))); Assert.assertTrue(a.equals(b)); Assert.assertTrue(a.hashCode() == b.hashCode()); Assert.assertTrue(a.compareTo(b) == 0); }