if ((allAcls == null) || (allAcls.length == 0)) { return null; }
    public AclEntry[] resolveEffectiveAcls(AclEntry[] allAcls,        Authentication filteredBy) {        List list = new Vector();        for (int i = 0; i < allAcls.length; i++) {            if (!(allAcls[i] instanceof BasicAclEntry)) {                continue;            }            Object recipient = ((BasicAclEntry) allAcls[i]).getRecipient();            // Allow the Authentication's getPrincipal to decide whether            // the presented recipient is "equal" (allows BasicAclDaos to            // return Strings rather than proper objects in simple cases)            if (filteredBy.getPrincipal().equals(recipient)) {                list.add(allAcls[i]);            } else {                // No direct match against principal; try each authority.                // As with the principal, allow each of the Authentication's                // granted authorities to decide whether the presented                // recipient is "equal"                GrantedAuthority[] authorities = filteredBy.getAuthorities();                if ((authorities == null) || (authorities.length == 0)) {                    continue;                }                for (int k = 0; k < authorities.length; k++) {                    if (authorities[k].equals(recipient)) {                        list.add(allAcls[i]);                    }                }            }        }        // return null if appropriate (as per interface contract)        if (list.size() > 0) {            return (BasicAclEntry[]) list.toArray(new BasicAclEntry[] {});        } else {            return null;        }    }