@Override public boolean equals( Object o ) {
    if ( this == o ) {
      return true;
    }
    if ( o == null || getClass() != o.getClass() ) {
      return false;
    }

    ActingPrincipal that = (ActingPrincipal) o;

    if ( isAnonymous() != that.isAnonymous() ) {
      return false;
    }
    return getName() != null ? getName().equals( that.getName() ) : that.getName() == null;
  }
@Test
  public void equals() throws Exception {
    principal1 = new ActingPrincipal( "suzy" );
    principal2 = new ActingPrincipal( "joe" );

    assertFalse( principal1.equals( principal2 ) );
    assertFalse( principal1.equals( ActingPrincipal.ANONYMOUS ) );

    principal2 = new ActingPrincipal( "suzy" );

    assertTrue( principal1.equals( principal2 ) );

    principal2 = ActingPrincipal.ANONYMOUS;
    assertTrue( principal2.equals( ActingPrincipal.ANONYMOUS ) );

  }