code: public static StringBuilder getContextUrlString(String baseUrl, String context) throws MalformedURLException {
          StringBuilder urlStr = new StringBuilder(baseUrl);
          ensureEndsWithSlash(urlStr);
          if (context != null && context.length() > 0) {
              if (context.startsWith("/")) {
                  urlStr.append(context.substring(1));
              } else {
                  urlStr.append(context);
              }
              ensureEndsWithSlash(urlStr);
          }
          return urlStr;
      }
docs: Given a base URL (like 'http://localhost:8080') this will append the given context string to it and will return
  the URL with a forward-slash as its last character.
  
  This returns a StringBuilder so the caller can continue building its desired URL by appending to it additional
  context paths, query strings, and the like.
  
  @param baseUrl base URL to append the given context to
  @param context the context to add to the given base URL
  @return the base URL with the context appended to it
  
  @throws MalformedURLException if URL cannot be built