protected static void testEff(Group g, Group gm, Member m) {  Set isMember    = g.toMember().getMemberships(); Set hasMembers  = gm.getMemberships(); Iterator iter   = isMember.iterator(); while (iter.hasNext()) { Membership is = (Membership) iter.next();  _testEff(is, m); Iterator iterHM = hasMembers.iterator(); while (iterHM.hasNext()) { Membership hs = (Membership) iterHM.next();  _testEff(g, hs);  _testEff(is, hs);
protected static void testEff( GrouperSession s, Group g, Subject subj, String list, Group via, int depth ) { try {  Field   f = FieldFinder.find(list); Member  m = MemberFinder.findBySubject(s, subj); Assert.assertTrue("m.subj == subj", m.getSubject().equals(subj)); Assert.assertTrue("g hasMember"   , g.hasMember(subj, f)); Assert.assertTrue("g hasEffMember", g.hasEffectiveMember(subj, f)); Assert.assertTrue("m isMember"    , m.isMember(g, f)); Assert.assertTrue("m isEffMember" , m.isEffectiveMember(g, f)); Membership ms = MembershipFinder.findEffectiveMembership( s, g, subj, f, via, depth ); Assert.assertNotNull("found ms", ms); Assert.assertTrue("ms group   " , ms.getGroup().equals(g) ); Assert.assertTrue("ms member"   , ms.getMember().equals(m)); Assert.assertTrue("ms list"     , ms.getList().equals(f)  ); Assert.assertTrue("ms depth"    , ms.getDepth() == depth  ); try { Group v = ms.getViaGroup(); Assert.assertTrue("ms via group", v.equals(via)); } catch (GroupNotFoundException eGNF) { Assert.fail("eff ms has no via group");
  protected static void testEff(Group g, Group gm, Member m) {    // Get memberships    Set isMember    = g.toMember().getMemberships();    Set hasMembers  = gm.getMemberships();    Iterator iter   = isMember.iterator();    while (iter.hasNext()) {      Membership is = (Membership) iter.next();      // g-isMember hasMember m      _testEff(is, m);      Iterator iterHM = hasMembers.iterator();      while (iterHM.hasNext()) {      Membership hs = (Membership) iterHM.next();        // g hasMember m-hasMember        _testEff(g, hs);        // g-isMember hasMember m-hasMember        _testEff(is, hs);      }    }  } // protected static void testEff(g, gm, m)