protected Url toUrl(@NotNull String base, @NotNull String path, @Nullable String parameters) throws MalformedURLException {
    Url baseUrl = Urls.parse(base, false);
    if (baseUrl == null || baseUrl.getScheme() == null || baseUrl.getAuthority() == null) {
      throw new MalformedURLException("cannot parse " + base);
    }
    String newPath = baseUrl.getPath().endsWith("/") ? baseUrl.getPath() + path : baseUrl.getPath() + "/" + path;
    return Urls.newUrl(baseUrl.getScheme(), baseUrl.getAuthority(), newPath, parameters == null ? null : "?" + parameters);
  }
protected Url toUrl(@NotNull String base, @NotNull String path, @Nullable String parameters)