code: public static URLBuilder createFromURL(URL url)
    {
      if(url == null)
        return null;
      
      // fast implementation
      if(url instanceof URLBuilder)
      {
        URLBuilder urlBuilder = (URLBuilder) url;
        return urlBuilder.deepClone();
      }
  
      try
      {
        return createFromURL(url.getURL());
      }
      catch(URISyntaxException e)
      {
        throw new RuntimeException("bad url!" + url.getURL());
      }
    }
docs: Factory method from a url
  
  @param url the url
  @return the builder