docs: public static URL appendTrailingSlash(URL originalURL) {
          try {
              return originalURL.getPath().endsWith("/") ? originalURL :
                      new URL(originalURL.getProtocol(),
                              originalURL.getHost(),
                              originalURL.getPort(),
                              originalURL.getFile() + '/');
          } catch (MalformedURLException ignored) { // shouldn't happen
              throw new IllegalArgumentException("Invalid resource URL: " + originalURL);
          }
      }