@Test
  public void testEquality() {
    HostAndPort hostAndPort1 = new HostAndPort("127.0.0.1", 8091);
    HostAndPort hostAndPort2 = new HostAndPort("127.0.0.1", 8091);
    HostAndPort hostAndPort3 = new HostAndPort("127.0.0.1", 8092);
    assertThat(hostAndPort1.getSocketInetAddress()).isSameAs(hostAndPort1.getSocketInetAddress());
    assertThat(hostAndPort1).isEqualTo(hostAndPort1);
    assertThat(hostAndPort1).isEqualTo(hostAndPort2);
    assertThat(hostAndPort1).isNotEqualTo(hostAndPort3);
    assertThat(hostAndPort1.equals(null)).isFalse();
  }
Test whether HostAndPort are equal, when created from resolved and unresolved
InetSocketAddress
geode-tcp-server/src/test/java/org/apache/geode/distributed/internal/tcpserver/HostAndPortTest.java