@Test public void testEquals() { assertEqualsContract( new PermissionGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), Permission.ADMIN), new PermissionGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), Permission.ADMIN), new PermissionGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), Permission.ADMIN), new PermissionGrantedAuthority( new GrantedAuthorityTarget("project2", Type.PROJECT), Permission.ADMIN)); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { PermissionGrantedAuthority other = (PermissionGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.permission, permission) .isEquals(); } return false; }
PermissionGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { PermissionGrantedAuthority other = (PermissionGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.permission, permission) .isEquals(); } return false; } }
PermissionGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { PermissionGrantedAuthority other = (PermissionGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.permission, permission) .isEquals(); } return false; } PermissionGrantedAuthority(GrantedAuthorityTarget target, Permission permission); }
PermissionGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { PermissionGrantedAuthority other = (PermissionGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.permission, permission) .isEquals(); } return false; } PermissionGrantedAuthority(GrantedAuthorityTarget target, Permission permission); @Override String getAuthority(); @Override boolean equals(Object o); @Override int hashCode(); }
PermissionGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { PermissionGrantedAuthority other = (PermissionGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.permission, permission) .isEquals(); } return false; } PermissionGrantedAuthority(GrantedAuthorityTarget target, Permission permission); @Override String getAuthority(); @Override boolean equals(Object o); @Override int hashCode();  }