code: public void setEntry(AclEntry entry) {
      // TODO(cc): when setting non-mask entries, the mask should be dynamically updated too.
      switch (entry.getType()) {
        case NAMED_USER:
          mNamedUserActions.put(entry.getSubject(), entry.getActions());
          return;
        case NAMED_GROUP:
          mNamedGroupActions.put(entry.getSubject(), entry.getActions());
          return;
        case MASK:
          mMaskActions = entry.getActions();
          return;
        case OWNING_USER:  // fall through
        case OWNING_GROUP: // fall through
        case OTHER:
          throw new IllegalStateException(
              "Deleting base entry is not allowed. entry: " + entry);
        default:
          throw new IllegalStateException("Unknown ACL entry type: " + entry.getType());
      }
    }
docs: Sets an entry into the access control list.
  If an entry with the same type and subject already exists, overwrites the existing entry;
  Otherwise, adds this new entry.
  
  @param entry the entry to be added or updated