code: private boolean isInvalidURL(String url) {
          try {
              final URL u = new URL(url);
              u.toURI();
          } catch (MalformedURLException | URISyntaxException e) {
              LOGGER.trace("URL is invalid: {}", url);
              return true;
          }
          return false;
      }
docs: Tests to determine if the given URL is <b>invalid</b>.
  
  @param url the URL to evaluate
  @return true if the URL is malformed; otherwise false