code: protected final String prepareUri(final URI uri) {
          if (compareRelative) {
              final String path = uri.getRawPath();
              final String query = uri.getRawQuery();
              final String fragment = uri.getRawFragment();
              if (query != null && fragment != null) {
                  return path + "?" + query + "#" + fragment;
              } else if (query != null) {
                  return path + "?" + query;
              } else if (fragment != null) {
                  return path + "#" + fragment;
              } else {
                  return path;
              }
          } else {
              return uri.toString();
          }
      }
docs: Prepare the URI for matching.
  
  @param uri The URI.
  @return A String version of the URI to compare to the pattern.