code: static String buildUrl(int httpPort, String context) {
          final StringBuilder sb = new StringBuilder();
  
          sb.append("http://localhost:");
          if (httpPort == PORT_AUTO) {
              sb.append("[auto]");
          } else {
              sb.append(httpPort);
          }
          sb.append(context);
          return sb.toString();
      }
docs: Build a url for the specified port and context.
  <p/>
  If the <tt>httpPort</tt> is equal to {@link #PORT_AUTO}, the
  returned url is not used as is because no http port has been
  allocated yet.
  
  @param httpPort the http port to use
  @param context the context of the url
  @return a <tt>localhost</tt> url for the specified port and context