code: public List<ResourceGrant> releaseResource(List<Integer> idList) {
      if (deleted) {
        throw new RuntimeException("Session: " +
            sessionId + " has been deleted");
      }
  
      List<ResourceGrant> canceledGrants = new ArrayList<ResourceGrant>();
      for (Integer id : idList) {
        ResourceRequestInfo req = idToRequest.get(id);
  
        if (req != null) {
          idToRequest.remove(id);
          ResourceGrant grant = idToGrant.remove(id);
          if (grant != null) {
            // we have previously granted this resource, return to caller
            canceledGrants.add(grant);
            removeGrantedRequest(req, false);
          } else {
            removePendingRequest(req);
          }
  
          incrementRequestCount(req.getType(), -1);
        }
      }
      return canceledGrants;
    }
docs: Release the resources that are no longer needed from the session
  @param idList the list of resources to release
  @return the list of resources that have been released