@Test
  public void testSerializationWithNumericAddress() throws IOException, ClassNotFoundException {
    DSFIDSerializer dsfidSerializer = new DSFIDSerializerFactory().create();
    dsfidSerializer.register(HOST_AND_PORT, HostAndPort.class);
    HostAndPort hostAndPort1 = new HostAndPort("127.0.0.1", 8091);
    BufferDataOutputStream out = new BufferDataOutputStream(100, KnownVersion.CURRENT);
    dsfidSerializer.getObjectSerializer().writeObject(hostAndPort1, out);
    HostAndPort hostAndPort2 = dsfidSerializer.getObjectDeserializer()
        .readObject(new ByteArrayDataInput(out.toByteArray()));
    assertThat(hostAndPort1).isEqualTo(hostAndPort2);
    assertThat(hostAndPort2).isEqualTo(hostAndPort1);
  }
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