HostAndPort implements DataSerializableFixedID { public int getPort() { return socketInetAddress.getPort(); } HostAndPort();  HostAndPort(String hostName, int port); InetSocketAddress getSocketInetAddress(); String getHostName(); int getPort(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); InetAddress getAddress(); @Override int getDSFID(); @Override void toData(DataOutput out, SerializationContext context); @Override void fromData(DataInput in, DeserializationContext context); @Override KnownVersion[] getSerializationVersions();  }
@Test public void getPort_returns_port() { HostAndPort locator1 = new HostAndPort("localhost", 8090); assertThat(locator1.getPort()).isEqualTo(8090); }