code: public void setResourceId(AttributeValue resourceId) {
          this.resourceId = resourceId;
  
          // there will always be exactly one value for this attribute
          Collection attrSet = (Collection)(resourceMap.get(RESOURCE_ID));
          Attribute attr = (Attribute)(attrSet.iterator().next());
          
          // remove the old value...
          attrSet.remove(attr);
  
          // ...and insert the new value
          attrSet.add(new SingletonAttribute(attr.getId(), attr.getIssuer(),
                                    attr.getIssueInstant(), resourceId));
      }
docs: Changes the value of the resource-id attribute in this context. This
  is useful when you have multiple resources (ie, a scope other than
  IMMEDIATE), and you need to keep changing only the resource-id to
  evaluate the different effective requests.
  
  @param resourceId the new resource-id value