AccessControlManagerFacade implements AccessControlManager { @Override public final boolean hasPrivileges(String absPath, Privilege[] privileges) throws RepositoryException { return delegate.hasPrivileges(absPath, privileges); } @SuppressWarnings("WeakerAccess")  AccessControlManagerFacade(final @NotNull M delegate); static @Nullable AccessControlManager findBestWrapper(final @Nullable AccessControlManager manager); @Override final Privilege[] getSupportedPrivileges(String absPath); @Override final Privilege privilegeFromName(String privilegeName); @Override final boolean hasPrivileges(String absPath, Privilege[] privileges); @Override final Privilege[] getPrivileges(String absPath); @Override final AccessControlPolicy[] getPolicies(String absPath); @Override final AccessControlPolicy[] getEffectivePolicies(String absPath); @Override final AccessControlPolicyIterator getApplicablePolicies(String absPath); @Override final void setPolicy(String absPath, AccessControlPolicy policy); @Override final void removePolicy(String absPath, AccessControlPolicy policy);  }
@Test public void testHasPrivileges() throws Exception { AccessControlManager delegate = mock(AccessControlManager.class); AccessControlManagerFacade<AccessControlManager> facade = getFacade(delegate); final Privilege[] value = new Privilege[0]; final String path = "/correct/path"; when(delegate.hasPrivileges(path, value)).thenReturn(true); assertTrue("is true", facade.hasPrivileges(path, value)); }