Subject subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT);
Subject subj = null; try { subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT); } catch (SubjectNotFoundException e1) {  e1.printStackTrace(); }
  public void testQueryMemAllEffAndImm() {    Subject subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT);    GrouperSession s = GrouperSession.start(subj);    // Create ns0    GrouperStem ns0 = GrouperStem.create(                         s, Constants.ns0s, Constants.ns0e                       );    // Create gA    GrouperGroup gA = GrouperGroup.create(                         s, Constants.gBs, Constants.gAe                       );    // Create gB    GrouperGroup gB = GrouperGroup.create(                         s, Constants.gBs, Constants.gBe                       );    // Create gC    GrouperGroup gC = GrouperGroup.create(                         s, Constants.gCs, Constants.gCe                       );    // Add gC to gA    try {      gA.listAddVal(gC.toMember());    } catch (RuntimeException e) {      Assert.fail("add gC to gA");    }    // Create query object    GrouperQuery q = new GrouperQuery(s);    // We want MEM_ALL    try {      Assert.assertTrue("MEM_ALL true", q.membershipType(Grouper.MEM_ALL) );      List vals = q.query();      Assert.assertTrue("vals == 1", vals.size() == 1);      Assert.assertTrue(        "right class",         Constants.KLASS_GL.equals(vals.get(0).getClass().getName())      );    } catch (GrouperException e) {      Assert.fail("Exception: MEM_ALL");    }    // We want MEM_IMM    try {      Assert.assertTrue("MEM_IMM true",  q.membershipType(Grouper.MEM_IMM) );      List vals = q.query();      Assert.assertTrue("imm vals == 1", vals.size() == 1 );      Assert.assertTrue(        "right class",         Constants.KLASS_GL.equals(vals.get(0).getClass().getName())      );    } catch (GrouperException e) {      Assert.fail("Exception: MEM_IMM");    }    // We want MEM_EFF    try {      Assert.assertFalse("MEM_EFF false", q.membershipType(Grouper.MEM_EFF) );    } catch (GrouperException e) {      Assert.fail("Exception: MEM_EFF");    }    // We're done    s.stop();   }