Set stemSet = new LinkedHashSet(); Set allSet = new LinkedHashSet();  Member member = MemberFinder.findBySubject(s,s.getSubject()); for (int i = 0; i < privs.length; i++) { allSet.addAll(getGroupsOrStemsWhereMemberHasPriv(member,privs[i].toLowerCase())); } int end = start + pageSize; if (end > allSet.size()) end = allSet.size(); if (resultCount != null) { resultCount.setLength(0); resultCount.append("" + allSet.size()); }  Iterator it = allSet.iterator(); Stem stem = null; while(it.hasNext()){ stem = (Stem) it.next(); stemSet.add(stem); } return stemSet;
Set groups = null; if (groups != null) return null;  groups = getGroupsForPrivileges(s, privs, 0, 100000, null);  return groups;
	public static Set getStemsForPrivileges(GrouperSession s, String[] privs,			int start, int pageSize, StringBuffer resultCount) throws MemberNotFoundException{				Set stemSet = new LinkedHashSet();		Set allSet = new LinkedHashSet();				Member member = MemberFinder.findBySubject(s,s.getSubject());		for (int i = 0; i < privs.length; i++) {			allSet.addAll(getGroupsOrStemsWhereMemberHasPriv(member,privs[i].toLowerCase()));		}		int end = start + pageSize;		if (end > allSet.size())			end = allSet.size();		if (resultCount != null) {			resultCount.setLength(0);			resultCount.append("" + allSet.size());		}				Iterator it = allSet.iterator();		Stem stem = null;		while(it.hasNext()){			stem = (Stem) it.next();			stemSet.add(stem);		}		return stemSet;	}