public static Set getMembershipsSet(GrouperSession s, int start, int pageSize, StringBuffer totalCount) { Set memberships = new LinkedHashSet(); Member member = null; try { member = MemberFinder.findBySubject(s, s.getSubject()); } catch (Exception e) { throw new RuntimeException(e); } Set vals = member.getGroups();  Group group; int end = start + pageSize; if (end > vals.size()) end = vals.size(); if (totalCount != null) { totalCount.setLength(0); totalCount.append("" + vals.size()); }  Iterator it = vals.iterator(); while(it.hasNext()){  group = (Group) it.next(); memberships.add(group); } return memberships;
public static Set getMembershipsSet(GrouperSession s) { return getMembershipsSet(s, 0, 100000, null);
	public static Set getMembershipsSet(GrouperSession s, int start,			int pageSize, StringBuffer totalCount) {		Set memberships = new LinkedHashSet();		Member member = null;		try {			member = MemberFinder.findBySubject(s, s.getSubject());		} catch (Exception e) {			throw new RuntimeException(e);		}		Set vals = member.getGroups();				Group group;		int end = start + pageSize;		if (end > vals.size())			end = vals.size();		if (totalCount != null) {			totalCount.setLength(0);			totalCount.append("" + vals.size());		}				Iterator it = vals.iterator();		while(it.hasNext()){						group = (Group) it.next();			memberships.add(group);		}		return memberships;	}