Set groupSet = 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(); Group group = null; while(it.hasNext()){ group = (Group) it.next(); groupSet.add(group); } return groupSet;
return groups;
	public static Set getGroupsForPrivileges(GrouperSession s, String[] privs,			int start, int pageSize, StringBuffer resultCount) throws MemberNotFoundException{				Set groupSet = 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();		Group group = null;		while(it.hasNext()){			group = (Group) it.next();			groupSet.add(group);		}		return groupSet;	}