ImmutablePrincipalPolicy extends ImmutableACL implements PrincipalAccessControlList { @Override public boolean addEntry(@Nullable String effectivePath, @NotNull Privilege[] privileges) throws RepositoryException { throw new AccessControlException("Immutable PrincipalAccessControlList."); } 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(expected = AccessControlException.class) public void testAddEntry() throws Exception { immutable.addEntry(PathUtils.ROOT_PATH, privilegesFromNames(PrivilegeConstants.JCR_READ)); }
@Test(expected = AccessControlException.class) public void testAddEntryWithRestrictions() throws Exception { immutable.addEntry(null, privilegesFromNames(PrivilegeConstants.JCR_ALL), Collections.singletonMap(getNamePathMapper().getJcrName(REP_GLOB), getValueFactory(root).createValue("*")), Collections.emptyMap()); }