PermissionGrantedAuthority implements GrantedAuthority { @Override public int hashCode() { return new HashCodeBuilder() .append(target) .append(permission) .toHashCode(); } PermissionGrantedAuthority(GrantedAuthorityTarget target, Permission permission); @Override String getAuthority(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testHashCode() { assertHashCodeContract( new PermissionGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), Permission.ADMIN), new PermissionGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), Permission.ADMIN)); }