code: public HostAndPort withDefaultPort(int defaultPort) {
      checkArgument(isValidPort(defaultPort));
      if (hasPort() || port == defaultPort) {
        return this;
      }
      return new HostAndPort(host, defaultPort, hasBracketlessColons);
    }
docs: Provide a default port if the parsed string contained only a host.
  
  You can chain this after {@link #fromString(String)} to include a port in case the port was
  omitted from the input string. If a port was already provided, then this method is a no-op.
  
  @param defaultPort a port number, from [0..65535]
  @return a HostAndPort instance, guaranteed to have a defined port.