### Question:
HServerAddress implements WritableComparable<HServerAddress> { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null) return false; if (getClass() != o.getClass()) return false; return compareTo((HServerAddress)o) == 0; } HServerAddress();  HServerAddress(InetSocketAddress address);  HServerAddress(final String hostname, final int port);  HServerAddress(HServerAddress other); String getBindAddress(); int getPort(); String getHostname(); String getHostnameAndPort(); InetSocketAddress getInetSocketAddress(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); void readFields(DataInput in); void write(DataOutput out); int compareTo(HServerAddress o);  }### Answer:
@Test public void testHServerAddressString() { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerAddress hsa2 = new HServerAddress(new InetSocketAddress("localhost", 1234)); assertTrue(hsa1.equals(hsa2)); }