code: public void merge(Resource resource) {
          if (resource == null) {
              return;
          }
  
          checkRel(resource);
          checkHrefs(resource);
  
          if (resource.templated()) {
              this.pathParams.putAll(resource.pathParams);
              this.queryParams.putAll(resource.queryParams);
          }
          if (resource.hints() != null) {
              this.hints.merge(resource.hints());
          }
      }
docs: Merges the current resource with another resource instance.
  The merge objects must represent the same resource but can
  come from multiple methods.
  
  @param resource the resource object to merge