### Question:
HostnamePort { public String getHost() { return host; } HostnamePort( String hostnamePort );  HostnamePort( String host, int port );  HostnamePort( String host, int portFrom, int portTo ); String getHost(); static String getHostAddress( String host, String defaultHost ); String getHost( String defaultHost ); int[] getPorts(); int getPort(); boolean isRange(); @Override String toString(); String toString( String defaultHost ); boolean matches( URI toMatch ); @Override boolean equals( Object o ); @Override int hashCode();  }### Answer:
@Test void testDefaultHost() { HostnamePort hostnamePort = new HostnamePort( ":1234" ); assertThat( hostnamePort.getHost( "1.2.3.4" ), equalTo( "1.2.3.4" ) ); }