Membership  ms  = (Membership) iter.next(); Membership  eff = MembershipFinder.findEffectiveMembership(
Membership  ms    = (Membership) iter.next(); Set         effs  = MembershipFinder.findEffectiveMemberships(
  private static Set _membershipsToDelete(GrouperSession s, Membership imm)     throws  MemberDeleteException  {    GrouperSession.validate(s);    Set     mships  = new LinkedHashSet();    Field   f       = imm.getList();    String  msg     = "_membershipsToDelete '" + f + "'";    GrouperLog.debug(LOG, s, msg);    try {      Member m = imm.getMember();      GrouperLog.debug(LOG, s, msg + " immediate member: " + imm);      // Find effective memberships      // As many of the memberships are likely to be transient, we      // need to retrieve the persistent version of each before      // passing it along to be deleted by HibernateHelper.        Session   hs    = HibernateHelper.getSession();      Iterator  iter  = MemberOf.doMemberOf(s, imm).iterator();      while (iter.hasNext()) {        Membership  ms  = (Membership) iter.next();        Membership  eff = MembershipFinder.findEffectiveMembership(          ms.getOwner_id(), ms.getMember().getId(),           ms.getList(), ms.getVia_id(), ms.getDepth()        );        eff.setSession(s);        GrouperLog.debug(LOG, s, msg + " effective member: " + eff);        mships.add(eff);      }      hs.close();    }    catch (Exception e) {      GrouperLog.debug(LOG, s, msg + ": " + e.getMessage());      throw new MemberDeleteException(e.getMessage());    }    return mships;  } // private static Set _membershipsToDelete(s, imm)