public boolean equals(Object another){
  if (another instanceof PrincipalImpl) {
    PrincipalImpl p=(PrincipalImpl)another;
    return user.equals(p.toString());
  }
 else   return false;
}

public boolean equals ( Object another ) { if ( another instanceof PrincipalImpl ) { PrincipalImpl p = ( PrincipalImpl ) another ; return user . equals ( p . toString ( ) ) ; } else return false ; }
this function returns true if the object passed matches the principal represented in this implementation
