/**
   * Gets the list of {@link Grant} objects in this access control list (ACL).
   *
   * @return The list of {@link Grant} objects in this ACL.
   */
  public List<Grant> getGrantsAsList() {
    checkState();
    if (grantList == null) {
      if (grantSet == null) {
        grantList = new LinkedList<Grant>();
      } else {
        grantList = new LinkedList<Grant>(grantSet);
        grantSet = null;
      }
    }

    return grantList;
  }
 /**
  * Gets the set of {@link Grant} objects in this access control list (ACL).
  *
  * @return The set of {@link Grant} objects in this ACL.
  * @deprecated This will remove the duplicate grants if received from Amazon S3. Use {@link
  *     AccessControlList#getGrantsAsList} instead.
  */
 @Deprecated
 public Set<Grant> getGrants() {
   checkState();
   if (grantSet == null) {
     if (grantList == null) {
       grantSet = new HashSet<Grant>();
     } else {
       grantSet = new HashSet<Grant>(grantList);
       grantList = null;
     }
   }
   return grantSet;
 }