AddressableNamedEntity implements AddressableEntity { @Override public boolean equals(Object obj) { if (obj instanceof AddressableNamedEntity) { AddressableNamedEntity that = (AddressableNamedEntity) obj; return Objects.equal(this.self, that.self) && Objects.equal(this.name, that.name); } return false; } AddressableNamedEntity(URI self, String name); @Override URI getSelf(); String getName(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testEquals() { TestUtil.assertEqualsSymmetrical(P1, P2); assertEquals(P1, P1); assertNotEquals(P1, null); assertNotEquals(P1, P3); assertNotEquals(P1, P4); }