/**
   * Checks two ServicePermission objects for equality.
   *
   * <p>
   *
   * @param obj the object to test for equality with this object.
   * @return true if <i>obj</i> is a ServicePermission, and has the same service principal, and
   *     actions as this ServicePermission object.
   */
  public boolean equals(Object obj) {
    if (obj == this) return true;

    if (!(obj instanceof ServicePermission)) return false;

    ServicePermission that = (ServicePermission) obj;
    return ((this.mask & that.mask) == that.mask) && this.getName().equals(that.getName());
  }
 boolean impliesIgnoreMask(ServicePermission p) {
   return ((this.getName().equals("*")) || this.getName().equals(p.getName()));
 }