code: public static URI resolve(String relUri, URI base) {
          URI uri = createURI(relUri);
          if (uri.getScheme() == null && uri.getUserInfo() == null && uri.getHost() == null && uri.getPort() == -1
                  && StringUtils.isEmpty(uri.getPath()) && uri.getQuery() != null) {
              try {
                  return new URI(base.getScheme(), base.getUserInfo(), base.getHost(), base.getPort(), base.getPath(),
                          uri.getQuery(), uri.getFragment());
              } catch (URISyntaxException e) {
                  throw new InvalidUriException(e);
              }
          } else {
              return base.resolve(uri);
          }
      }
docs: Interpret the url relatively to the request url (may be relative). Due to a bug in {@link URI} class when using a
  relUri containing only a query string, we cannot use directly the method provided by {@link URI} class.
  
  @param relUri
  the relative URI
  @param base
  the reference {@link URI}
  @return the resolved {@link URI}