ImmutablePrincipalPolicy extends ImmutableACL implements PrincipalAccessControlList { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof ImmutablePrincipalPolicy) { ImmutablePrincipalPolicy other = (ImmutablePrincipalPolicy) obj; return Objects.equal(getOakPath(), other.getOakPath()) && principal.equals(other.principal) && getEntries().equals(other.getEntries()); } return false; } ImmutablePrincipalPolicy(@NotNull Principal principal, @NotNull String oakPath, @NotNull List<? extends PrincipalAccessControlList.Entry> entries, @NotNull RestrictionProvider restrictionProvider, @NotNull NamePathMapper namePathMapper);  ImmutablePrincipalPolicy(@NotNull PrincipalPolicyImpl accessControlList); @Override @NotNull Principal getPrincipal(); @Override boolean addEntry(@Nullable String effectivePath, @NotNull Privilege[] privileges); @Override boolean addEntry(@Nullable String effectivePath, @NotNull Privilege[] privileges, @NotNull Map<String, Value> restrictions, @NotNull Map<String, Value[]> mvRestrictions); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testEquals() { ImmutablePrincipalPolicy ipp = new ImmutablePrincipalPolicy(policy.getPrincipal(), policy.getOakPath(), policy.getEntries(), policy.getRestrictionProvider(), policy.getNamePathMapper()); assertEquals(immutable, ipp); assertEquals(immutable, new ImmutablePrincipalPolicy(policy)); assertEquals(immutable, immutable); }