### Question:
HRegionLocation implements Comparable<HRegionLocation> { @Override public synchronized String toString() { if (this.cachedString == null) { this.cachedString = "region=" + this.regionInfo.getRegionNameAsString() + ", hostname=" + this.hostname + ", port=" + this.port; } return this.cachedString; } HRegionLocation(HRegionInfo regionInfo, final String hostname,
      final int port); @Override synchronized String toString(); @Override boolean equals(Object o); @Override int hashCode(); HRegionInfo getRegionInfo(); HServerAddress getServerAddress(); String getHostname(); int getPort(); synchronized String getHostnamePort(); int compareTo(HRegionLocation o);  }### Answer:
@Test public void testToString() { ServerName hsa1 = new ServerName("localhost", 1234, -1L); HRegionLocation hrl1 = new HRegionLocation(HRegionInfo.FIRST_META_REGIONINFO, hsa1.getHostname(), hsa1.getPort()); System.out.println(hrl1.toString()); }