ImmutablePrincipalPolicy extends ImmutableACL implements PrincipalAccessControlList { @Override public int hashCode() { if (hashCode == 0) { hashCode = Objects.hashCode(principal, getOakPath(), getEntries()); } return hashCode; } 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 testHashcode() { int expectedHashCode = immutable.hashCode(); ImmutablePrincipalPolicy ipp = new ImmutablePrincipalPolicy(policy.getPrincipal(), policy.getOakPath(), policy.getEntries(), policy.getRestrictionProvider(), policy.getNamePathMapper()); assertEquals(expectedHashCode, ipp.hashCode()); assertEquals(expectedHashCode, new ImmutablePrincipalPolicy(policy).hashCode()); }