@Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (this.ip == null ? 0 : this.ip.hashCode());
        result = prime * result + this.port;
        return result;
    }
@Test
    public void testEqualsHashCode() {
        final Endpoint ep1 = new Endpoint("192.168.1.1", 8080);
        final Endpoint ep2 = new Endpoint("192.168.1.1", 8080);
        assertEquals(ep1, ep2);
        assertEquals(ep1.hashCode(), ep2.hashCode());
    }