### Question:
Connector { public String getEndpointAsString() { String host; try { host = InetAddress.getByName(m_hostString).toString(); } catch (UnknownHostException e) { host = m_hostString; } return host + ":" + m_port; } Connector(String hostString,
                   int port,
                   ConnectionType connectionType); @Override int hashCode(); @Override boolean equals(Object o); String getEndpointAsString();  }### Answer:
@Test public void testGetEndpointAsString() throws Exception { assertEquals( "a:1234", new Connector("a", 1234, ConnectionType.WORKER).getEndpointAsString()); final String description = new Connector("", 1234, ConnectionType.WORKER).getEndpointAsString(); assertContains(description, "localhost"); assertContains(description, "1234"); }