code: protected <T> Optional<T> executePatchRequest(URI uri, Object obj, Map<String, Object> headers, 
          List<String> queryParams, GenericType<T> returnType)
      {
          WebTarget target = this.client.target(uri);
          target = applyQueryParams(target, queryParams);
          Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
          applyHeaders(invocation, headers);
          if(obj == null)
              obj = Entity.text("");
          Response response = invocation.method("PATCH", Entity.entity(obj, MediaType.APPLICATION_JSON));
          handleResponseError("PATCH", uri, response);
          logResponse(uri, response);
          return extractEntityFromResponse(response, returnType);
      }
docs: Execute a PATCH request with a return object.
  @param <T> The type parameter used for the return object
  @param uri The URI to call
  @param obj The object to use for the PATCH
  @param headers A set of headers to add to the request
  @param queryParams A set of query parameters to add to the request
  @param returnType The type to marshall the result back into
  @return The return type