LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.0");
  public void testBadEffMshipDepthCalcExposedByGroupDelete() {    LOG.info("testBadEffMshipDepthCalcExposedByGroupDelete");    try {      Subject kebe = SubjectHelper.SUBJ0;      Subject iata = SubjectHelper.SUBJ1;      Subject iawi = SubjectHelper.SUBJ2;      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.0");      Subject subj = SubjectFinder.findById("GrouperSystem");      GrouperSession s = GrouperSession.start(subj);      Stem root = StemFinder.findRootStem(s);			Stem qsuob = root.addChildStem("qsuob","qsuob");      Group admins = qsuob.addChildGroup("admins","admins");      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.0");      admins.addMember(kebe);      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.1");      Group staff = qsuob.addChildGroup("staff","staff");      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.2");      staff.addMember(iata);      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testNumMship(staff, "members", 1, 1, 0);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.3");      staff.addMember(iawi);      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.4");      Group all_staff = qsuob.addChildGroup("all_staff","all staff");      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.5");      all_staff.addMember(staff.toSubject());      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testImm(s, all_staff, staff.toSubject() , "members");      MembershipHelper.testEff(s, all_staff, iata, "members", staff, 1);      MembershipHelper.testEff(s, all_staff, iawi, "members", staff, 1);      MembershipHelper.testNumMship(all_staff, "members", 3, 1, 2);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.6");      admins.grantPriv(admins.toSubject(),Privilege.getInstance("admin"));      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testImm(s, admins, subj, "admins");      MembershipHelper.testImm(s, admins, admins.toSubject(), "admins");      MembershipHelper.testEff(s, admins, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testNumMship(admins, "admins", 3, 2, 1);      MembershipHelper.testImm(s, all_staff, staff.toSubject() , "members");      MembershipHelper.testEff(s, all_staff, iata, "members", staff, 1);      MembershipHelper.testEff(s, all_staff, iawi, "members", staff, 1);      MembershipHelper.testNumMship(all_staff, "members", 3, 1, 2);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.7");      qsuob.grantPriv(admins.toSubject(),Privilege.getInstance("create"));      // TODO test      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.8");      qsuob.grantPriv(admins.toSubject(),Privilege.getInstance("stem"));      // TODO test      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.9");      staff.grantPriv(all_staff.toSubject(),Privilege.getInstance("read"));      // TODO test      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testImm(s, admins, subj, "admins");      MembershipHelper.testImm(s, admins, admins.toSubject(), "admins");      MembershipHelper.testEff(s, admins, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testNumMship(admins, "admins", 3, 2, 1);      MembershipHelper.testImm(s, all_staff, staff.toSubject() , "members");      MembershipHelper.testEff(s, all_staff, iata, "members", staff, 1);      MembershipHelper.testEff(s, all_staff, iawi, "members", staff, 1);      MembershipHelper.testNumMship(all_staff, "members", 3, 1, 2);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      MembershipHelper.testImm(s, staff, all_staff.toSubject(), "readers");      MembershipHelper.testEff(s, staff, iata, "readers", staff, 2);      MembershipHelper.testEff(s, staff, iawi, "readers", staff, 2);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.10");      staff.grantPriv(admins.toSubject(),Privilege.getInstance("admin"));      // TODO test      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testImm(s, admins, subj, "admins");      MembershipHelper.testImm(s, admins, admins.toSubject(), "admins");      MembershipHelper.testEff(s, admins, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testNumMship(admins, "admins", 3, 2, 1);      MembershipHelper.testImm(s, all_staff, staff.toSubject() , "members");      MembershipHelper.testEff(s, all_staff, iata, "members", staff, 1);      MembershipHelper.testEff(s, all_staff, iawi, "members", staff, 1);      MembershipHelper.testNumMship(all_staff, "members", 3, 1, 2);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testImm(s, staff, admins.toSubject(), "admins");      MembershipHelper.testEff(s, staff, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      MembershipHelper.testNumMship(staff, "admins", 3, 2, 1);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.11");      all_staff.grantPriv(all_staff.toSubject(),Privilege.getInstance("read"));      // TODO test      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testImm(s, admins, subj, "admins");      MembershipHelper.testImm(s, admins, admins.toSubject(), "admins");      MembershipHelper.testEff(s, admins, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testNumMship(admins, "admins", 3, 2, 1);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.11.0");      MembershipHelper.testImm(s, all_staff, staff.toSubject() , "members");      MembershipHelper.testEff(s, all_staff, iata, "members", staff, 1);      MembershipHelper.testEff(s, all_staff, iawi, "members", staff, 1);      MembershipHelper.testNumMship(all_staff, "members", 3, 1, 2);      MembershipHelper.testImm(s, all_staff, all_staff.toSubject(), "readers");      MembershipHelper.testEff(s, all_staff, staff.toSubject(), "readers", all_staff, 1);      MembershipHelper.testEff(s, all_staff, iata, "readers", staff, 2);      MembershipHelper.testEff(s, all_staff, iawi, "readers", staff, 2);      MembershipHelper.testNumMship(all_staff, "readers", 5, 2, 3);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.11.1");      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testImm(s, staff, admins.toSubject(), "admins");      MembershipHelper.testEff(s, staff, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      MembershipHelper.testNumMship(staff, "admins", 3, 2, 1);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.12");      all_staff.grantPriv(admins.toSubject(),Privilege.getInstance("admin"));      // TODO test      MembershipHelper.testImm(s, admins, kebe, "members");      MembershipHelper.testImm(s, admins, subj, "admins");      MembershipHelper.testImm(s, admins, admins.toSubject(), "admins");      MembershipHelper.testEff(s, admins, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(admins, "members", 1, 1, 0);      MembershipHelper.testNumMship(admins, "admins", 3, 2, 1);      MembershipHelper.testImm(s, all_staff, staff.toSubject() , "members");      MembershipHelper.testEff(s, all_staff, iata, "members", staff, 1);      MembershipHelper.testEff(s, all_staff, iawi, "members", staff, 1);      MembershipHelper.testNumMship(all_staff, "members", 3, 1, 2);      MembershipHelper.testImm(s, all_staff, all_staff.toSubject(), "readers");      MembershipHelper.testEff(s, all_staff, staff.toSubject(), "readers", all_staff, 1);      MembershipHelper.testEff(s, all_staff, iata, "readers", staff, 2);      MembershipHelper.testEff(s, all_staff, iawi, "readers", staff, 2);      MembershipHelper.testNumMship(all_staff, "readers", 5, 2, 3);      MembershipHelper.testImm(s, all_staff, subj, "admins");      MembershipHelper.testImm(s, all_staff, admins.toSubject(), "admins");      MembershipHelper.testEff(s, all_staff, kebe, "admins", admins, 1);      MembershipHelper.testImm(s, staff, iata , "members");      MembershipHelper.testImm(s, staff, iawi , "members");      MembershipHelper.testImm(s, staff, admins.toSubject(), "admins");      MembershipHelper.testEff(s, staff, kebe, "admins", admins, 1);      MembershipHelper.testNumMship(staff, "members", 2, 2, 0);      MembershipHelper.testNumMship(staff, "admins", 3, 2, 1);      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.13");      GroupHelper.delete(s, admins, admins.getName());      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.14");      GroupHelper.delete(s, staff, staff.getName());      LOG.debug("testBadEffMshipDepthCalcExposedByGroupDelete.15");      GroupHelper.delete(s, all_staff, all_staff.getName());      s.stop();    }    catch (Exception e) {      Assert.fail("exception: " + e.getMessage());    }  } // public void testBadEffMshipDepthCalcExposedByGroupDelete() 