private static AccessControlList getList(AccessControlManager acMgr, String path)
     throws NotExecutableException, AccessDeniedException, RepositoryException {
   for (AccessControlPolicyIterator it = acMgr.getApplicablePolicies(path); it.hasNext(); ) {
     AccessControlPolicy acp = it.nextAccessControlPolicy();
     if (acp instanceof AccessControlList) {
       return (AccessControlList) acp;
     }
   }
   AccessControlPolicy[] acps = acMgr.getPolicies(path);
   for (int i = 0; i < acps.length; i++) {
     if (acps[i] instanceof AccessControlList) {
       return (AccessControlList) acps[i];
     }
   }
   throw new NotExecutableException("No AccessControlList at " + path);
 }
 private AccessControlList getAccessControlList(
     final AccessControlManager acMgr, final String path) throws RepositoryException {
   AccessControlPolicyIterator applicablePolicies = acMgr.getApplicablePolicies(path);
   while (applicablePolicies.hasNext()) {
     AccessControlPolicy policy = applicablePolicies.nextAccessControlPolicy();
     if (policy instanceof AccessControlList) {
       return (AccessControlList) policy;
     }
   }
   AccessControlPolicy[] policies = acMgr.getPolicies(path);
   for (int i = 0; i < policies.length; i++) {
     if (policies[i] instanceof AccessControlList) {
       return (AccessControlList) policies[i];
     }
   }
   throw new IllegalStateException("no access control list applies or is bound to node");
 }