code: static boolean usesStandardPort(URI uri) {
          int portNumber = uri.getPort();
          if (portNumber == -1) {
              return true;
          }
          String schema = uri.getScheme();
          int standardPort = schema.equals("https") ? 443 : 80;
          return portNumber == standardPort;
      }
docs: Determine if a url uses the standard port.
  <p>
  Port 80 for http, 443 for https.
  
  @param uri
  
  @return true if standard port is used.