Host implements NamedEndpoint, Serializable { @Override public String toString() { return name + ":" + port; } Host(final String name, final int port); static Host create(final String s); @Override String getHostName(); @Override int getPort(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testToString() throws Exception { final Host host1 = new Host("somehost", 8888); Assert.assertEquals("somehost:8888", host1.toString()); }