AppHandleConnectionSpec implements ConnectionSpec { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(clientHostName); sb.append('('); sb.append(clientAddress); sb.append(')'); if (division != null) { sb.append(division); sb.append(RpcUriUtils.DIVISION_CREDENTIALS_DELIMITER); } sb.append(handle); return sb.toString(); } AppHandleConnectionSpec(final String handle, String clientAddress, String clientHostName);  AppHandleConnectionSpec(final String handle, final String division, String clientAddress, String clientHostName); String getDivision(); String getHandle(); String getClientAddress(); String getClientHostName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() { AppHandleConnectionSpec h = new AppHandleConnectionSpec("1AB2C3D4E5F6", "960", "123.45.67.89", "www.example.org"); assertEquals("www.example.org(123.45.67.89)960:1AB2C3D4E5F6", h.toString()); }
@Test public void testToStringNoDivision() { AppHandleConnectionSpec h = new AppHandleConnectionSpec("1AB2C3D4E5F6", "123.45.67.89", "www.example.org"); assertEquals("www.example.org(123.45.67.89)1AB2C3D4E5F6", h.toString()); }