code: public static boolean isUsingNonDefaultPort(URI uri) {
          String scheme = uri.getScheme().toLowerCase();
          int port = uri.getPort();
          if (port <= 0) {
              return false;
          }
          if (scheme.equals(Protocol.HTTP.toString())) {
              return port != Protocol.HTTP.getDefaultPort();
          }
          if (scheme.equals(Protocol.HTTPS.toString())) {
              return port != Protocol.HTTPS.getDefaultPort();
          }
          return false;
      }
docs: Returns true if the specified URI is using a non-standard port (i.e. any port other than 80 for HTTP URIs or any
  port other than 443 for HTTPS URIs).
  
  @param uri the URI
  @return True if the specified URI is using a non-standard port, otherwise false.