code: public static HostAddress fromParts(String host, int port)
      {
          if (!isValidPort(port)) {
              throw new IllegalArgumentException("Port is invalid: " + port);
          }
          HostAddress parsedHost = fromString(host);
          if (parsedHost.hasPort()) {
              throw new IllegalArgumentException("host contains a port declaration: " + host);
          }
          return new HostAddress(parsedHost.host, port);
      }
docs: Build a HostAddress instance from separate host and port values.
  <p>
  <p>Note: Non-bracketed IPv6 literals are allowed.
  
  @param host the host string to parse.  Must not contain a port number.
  @param port a port number from [0..65535]
  @return if parsing was successful, a populated HostAddress object.
  @throws IllegalArgumentException if {@code host} contains a port number,
  or {@code port} is out of range.