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 testQueryTypesAndMems() {    Subject subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT);    GrouperSession s = GrouperSession.start(subj);    Assert.assertNotNull(s);    // 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                       );    try {      gA.listAddVal(gC.toMember());    } catch (RuntimeException e) {      Assert.fail("failed to add gC -> gA: " + e);    }    // Create query object    GrouperQuery q = new GrouperQuery(s);    // We want NS_TYPE + MEM_ALL    try {      // First NS_TYPE      Assert.assertFalse( q.groupType(Grouper.NS_TYPE) );      // Now MEM_ALL      Assert.assertTrue( q.membershipType(Grouper.MEM_ALL) );      List vals = q.query();      Assert.assertNotNull(vals);      Assert.assertTrue( vals.size() == 0 );    } catch (GrouperException e) {      Assert.fail("Exception: DEF_GROUP_TYPE,MEM_ALL");    }    // We want DEF_GROUP_TYPE + MEM_EFF    try {      // Clear all query filters      q.clear();      // First NS_TYPE      Assert.assertFalse( q.groupType(Grouper.NS_TYPE) );      // Now MEM_EFF      Assert.assertFalse( q.membershipType(Grouper.MEM_EFF) );    } catch (GrouperException e) {      Assert.fail("Exception: DEF_GROUP_TYPE,MEM_EFF");    }    // We want DEF_GROUP_TYPE + MEM_IMM    try {      // Clear all query filters      q.clear();      // First NS_TYPE      Assert.assertFalse( q.groupType(Grouper.NS_TYPE) );      // Now MEM_IMM      Assert.assertTrue( q.membershipType(Grouper.MEM_IMM) );      List vals = q.query();      Assert.assertNotNull(vals);      Assert.assertTrue( vals.size() == 0 );    } catch (GrouperException e) {      Assert.fail("Exception: DEF_GROUP_TYPE,MEM_IMM");    }    // We're done    s.stop();   }