Provide a way to compare domain object identities

Useful in application test suites, e.g.
```php
$user = new User();
$foo = new Foo($user);
$this->assertTrue($foo->getUser()->identity()->equals($user->identity()));
```