AbstractAccessControlList implements JackrabbitAccessControlList { @NotNull @Override public String[] getRestrictionNames() { Collection<RestrictionDefinition> supported = getRestrictionProvider().getSupportedRestrictions(getOakPath()); return Collections2.transform(supported, new Function<RestrictionDefinition, String>() { @Override public String apply(RestrictionDefinition definition) { return namePathMapper.getJcrName(definition.getName()); } }).toArray(new String[supported.size()]); } AbstractAccessControlList(@Nullable String oakPath,
                                     @NotNull NamePathMapper namePathMapper); @Nullable String getOakPath(); @NotNull NamePathMapper getNamePathMapper(); @NotNull abstract List<? extends JackrabbitAccessControlEntry> getEntries(); @NotNull abstract RestrictionProvider getRestrictionProvider(); @Nullable @Override String getPath(); @Override AccessControlEntry[] getAccessControlEntries(); @Override boolean addAccessControlEntry(Principal principal, Privilege[] privileges); @Override boolean isEmpty(); @Override int size(); @NotNull @Override String[] getRestrictionNames(); @Override int getRestrictionType(@NotNull String restrictionName); @Override boolean isMultiValueRestriction(@NotNull String restrictionName); @Override boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow); @Override boolean addEntry(@NotNull Principal principal, @NotNull Privilege[] privileges, boolean isAllow, @Nullable Map<String, Value> restrictions);  }
@Test public void testGetRestrictionNames() { AbstractAccessControlList acl = createEmptyACL(); String[] restrNames = acl.getRestrictionNames(); assertNotNull(restrNames); List<String> names = Lists.newArrayList(restrNames); for (RestrictionDefinition def : getRestrictionProvider().getSupportedRestrictions(getTestPath())) { assertTrue(names.remove(getNamePathMapper().getJcrName(def.getName()))); } assertTrue(names.isEmpty()); }