@Override
  public boolean equals(Object obj) {
    if (!(obj instanceof Permission)) {
      return false;
    }

    Permission other = (Permission) obj;
    if (actions.isEmpty() && other.actions.isEmpty()) {
      return true;
    } else if (!actions.isEmpty() && !other.actions.isEmpty()) {
      if (actions.size() != other.actions.size()) {
        return false;
      }
      return actions.containsAll(other.actions);
    }
    return false;
  }
Check if two permission equals regardless of actions. It is useful when merging a new
permission with an existed permission which needs to check two permissions's fields.
@param obj instance
@return true if equals, false otherwise
hbase-client/src/main/java/org/apache/hadoop/hbase/security/access/Permission.java