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 testBug355() {    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.gAs, Constants.gAe                       );    // Create gB    GrouperGroup gB  = GrouperGroup.create(                         s, Constants.gBs, Constants.gBe                       );    // Load m0    GrouperMember m0 = GrouperMember.load(                         s, Constants.mem0I, Constants.mem0T                       );        // Make m0 a member of gB    try {      gB.listAddVal(m0);      Assert.assertTrue("add m0 to gB", true);    } catch (RuntimeException e) {      Assert.fail("add m0 to gB");    };    // Inspect list values    // gA    Assert.assertTrue(      "gA.0 members == 0", gA.listVals().size() == 0    );    Assert.assertTrue(      "gA.0 imm members == 0", gA.listImmVals().size() == 0    );    Assert.assertTrue(      "gA.0 eff members == 0", gA.listEffVals().size() == 0    );    Assert.assertTrue(      "gA.0 members/R == 0", gA.listVals("readers").size() == 0    );    Assert.assertTrue(      "gA.0 imm members/R == 0", gA.listImmVals("readers").size() == 0    );    Assert.assertTrue(      "gA.0 eff members/R == 0", gA.listEffVals("readers").size() == 0    );    // gB    Assert.assertTrue(      "gB.0 members == 1", gB.listVals().size() == 1    );    Assert.assertTrue(      "gB.0 imm members == 1", gB.listImmVals().size() == 1    );    Assert.assertTrue(      "gB.0 eff members == 0", gB.listEffVals().size() == 0    );    // Make gB a member of gA    try {      gA.listAddVal(gB.toMember());      Assert.assertTrue("add gB to gA", true);    } catch (RuntimeException e) {      Assert.fail("add gB to gA");    };    // Inspect list values    // gA    Assert.assertTrue(      "gA.1 members == 2", gA.listVals().size() == 2    );    Assert.assertTrue(      "gA.1 imm members == 1", gA.listImmVals().size() == 1    );    Assert.assertTrue(      "gA.1j eff members == 1", gA.listEffVals().size() == 1    );    Assert.assertTrue(      "gA.1 members/R == 0", gA.listVals("readers").size() == 0    );    Assert.assertTrue(      "gA.1 imm members/R == 0", gA.listImmVals("readers").size() == 0    );    Assert.assertTrue(      "gA.1 eff members/R == 0", gA.listEffVals("readers").size() == 0    );    // gB    Assert.assertTrue(      "gB.1 members == 1", gB.listVals().size() == 1    );    Assert.assertTrue(      "gB.1 imm members == 1", gB.listImmVals().size() == 1    );    Assert.assertTrue(      "gB.1 eff members == 0", gB.listEffVals().size() == 0    );    // Grant gA READ on gA    Assert.assertTrue(      "grant gA READ on gA",       s.access().grant(s, gA, gA.toMember(), Grouper.PRIV_READ)    );    // Inspect list values    // gA    Assert.assertTrue(      "gA.2 members == 2", gA.listVals().size() == 2    );    Assert.assertTrue(      "gA.2 imm members == 1", gA.listImmVals().size() == 1    );    Assert.assertTrue(      "gA.2 eff members == 1", gA.listEffVals().size() == 1    );    Assert.assertTrue(      "gA.2 members/R == 3", gA.listVals("readers").size() == 3    );    Assert.assertTrue(      "gA.2 imm members/R == 1", gA.listImmVals("readers").size() == 1    );    Assert.assertTrue(      "gA.2 eff members/R == 2", gA.listEffVals("readers").size() == 2    );    // gB    Assert.assertTrue(      "gB.2 members == 1", gB.listVals().size() == 1    );    Assert.assertTrue(      "gB.2 imm members == 1", gB.listImmVals().size() == 1    );    Assert.assertTrue(      "gB.2 eff members == 0", gB.listEffVals().size() == 0    );    // Remove gB from gA    try {      gA.listDelVal(gB.toMember());      Assert.assertTrue("remove gB from gA", true);    } catch (RuntimeException e) {      Assert.fail("remove gB from gA");    };    // Inspect list values    // gA    Assert.assertTrue(      "gA.3 members == 0", gA.listVals().size() == 0    );    Assert.assertTrue(      "gA.3 imm members == 0", gA.listImmVals().size() == 0    );    Assert.assertTrue(      "gA.3 eff members == 0", gA.listEffVals().size() == 0    );    Assert.assertTrue(      "gA.3 members/R == 1", gA.listVals("readers").size() == 1    );    Assert.assertTrue(      "gA.3 imm members/R == 1", gA.listImmVals("readers").size() == 1    );    Assert.assertTrue(      "gA.3 eff members/R == 0", gA.listEffVals("readers").size() == 0    );    // gB    Assert.assertTrue(      "gB.3 members == 1", gB.listVals().size() == 1    );    Assert.assertTrue(      "gB.3 imm members == 1", gB.listImmVals().size() == 1    );    Assert.assertTrue(      "gB.3 eff members == 0", gB.listEffVals().size() == 0    );    s.stop();  }