GrouperSession s, String oid, String gmid, Set isMember, Set hasMembers
GrouperSession s, String oid, String gmid, Field f, Set isMember, Set hasMembers
  private static Set _findMembershipsOfMember(    GrouperSession s, String oid, String gmid, Set isMember, Set hasMembers  )   {    Set mships = new LinkedHashSet();    // Add members of m to where this group is a member    // For every member of m...    Iterator iterMofM = hasMembers.iterator();    while (iterMofM.hasNext()) {      Membership  mofm  = (Membership) iterMofM.next();      // ... add to this group      int         depth = mofm.getDepth() + 1;      String      vid   = mofm.getVia_id();      if (vid == null) {        vid = gmid;      }      Membership msMofM = new Membership(        s, oid, mofm.getMember_id(),        Group.getDefaultList(), vid, depth      );      mships.add(msMofM);      // ... and add to wherever this group is a member      Iterator iterGisM = isMember.iterator();      while (iterGisM.hasNext()) {        Membership gism = (Membership) iterGisM.next();        Membership msGisM = new Membership(          s, gism.getOwner_id(), mofm.getMember_id(),          Group.getDefaultList(), vid, depth + gism.getDepth()         );        mships.add(msGisM);      }    }    return mships;  } // private static Set _findMembershipsOfMember(s, oid, gmid, isMember, hasMembers)