ClientConfigurationImpl implements ClientConfiguration { @Override public int hashCode() { return (new HashCodeBuilder()).append(remoteAddress).toHashCode(); } ClientConfigurationImpl(InetAddress addr);  ClientConfigurationImpl(InetAddress addr, int port);  ClientConfigurationImpl(InetSocketAddress remoteAddress); @Override InetSocketAddress getRemoteAddress(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testHashCode() throws Exception { ClientConfigurationImpl c1 = new ClientConfigurationImpl(InetAddress.getByName("129.168.5.1"), 1000); ClientConfigurationImpl c2 = new ClientConfigurationImpl(InetAddress.getByName("129.168.5.1"), 1000); ClientConfigurationImpl c3 = new ClientConfigurationImpl(InetAddress.getByName("129.168.6.1"), 1000); ClientConfigurationImpl c4 = new ClientConfigurationImpl(InetAddress.getByName("129.168.5.1"), 2000); Assert.assertEquals(c1.hashCode(), c2.hashCode()); Assert.assertTrue(c1.hashCode() != c3.hashCode()); Assert.assertTrue(c1.hashCode() != c4.hashCode()); }