ValidationEntry { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ValidationEntry) { ValidationEntry other = (ValidationEntry) o; return isAllow == other.isAllow && Objects.equal(principalName, other.principalName) && privilegeBits.equals(other.privilegeBits) && restrictions.equals(other.restrictions); } return false; } ValidationEntry(@NotNull String principalName, @NotNull PrivilegeBits privilegeBits, boolean isAllow, @NotNull Set<Restriction> restrictions);  ValidationEntry(@NotNull String principalName, @NotNull PrivilegeBits privilegeBits, boolean isAllow, @NotNull Set<Restriction> restrictions, int index); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void testEquals() { assertEquals(entry, new ValidationEntry(entry.principalName, entry.privilegeBits, entry.isAllow, entry.restrictions)); assertEquals(entry, new ValidationEntry(entry.principalName, entry.privilegeBits, entry.isAllow, entry.restrictions, entry.index+1)); assertTrue(entry.equals(entry)); }