Subject subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT);
Subject subj = null; try { subj = SubjectFactory.getSubject(Constants.rootI, Constants.rootT); } catch (SubjectNotFoundException e) {  e.printStackTrace(); }
  public void testMoF() {    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 ns1    GrouperStem ns1 = GrouperStem.create(                         s, Constants.ns1s, Constants.ns1e                       );    // Load m0    GrouperMember m0 = GrouperMember.load(                         s, Constants.mem0I, Constants.mem0T                       );    // Load m1    GrouperMember m1 = GrouperMember.load(                         s, Constants.mem1I, Constants.mem1T                       );    // Grant m0 STEM on ns0    Assert.assertTrue(      "grant m0 STEM on ns0",       s.naming().grant(s, ns0, m0, Grouper.PRIV_STEM)    );    // Grant ns0 STEM on ns1    Assert.assertTrue(      "grant ns0 STEM on ns1",       s.naming().grant(s, ns1, ns0.toMember(), Grouper.PRIV_STEM)    );    // Assert privileges    Assert.assertTrue(      "ns0 has == 0 privs on ns0",       s.naming().has(s, ns0, ns0.toMember()).size() == 0    );    Assert.assertFalse(       "ns0 !STEM on ns0",      s.naming().has(s, ns0, ns0.toMember(), Grouper.PRIV_STEM)    );    Assert.assertFalse(       "ns0 !CREATE on ns0",      s.naming().has(s, ns0, ns0.toMember(), Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "ns1 has == 0 privs on ns0",       s.naming().has(s, ns0, ns1.toMember()).size() == 0    );    Assert.assertFalse(       "ns1 !STEM on ns0",      s.naming().has(s, ns0, ns1.toMember(), Grouper.PRIV_STEM)    );    Assert.assertFalse(       "ns1 !CREATE on ns0",      s.naming().has(s, ns0, ns1.toMember(), Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "root has == 2 privs on ns0",       s.naming().has(s, ns0).size() == 2    );    Assert.assertTrue(      "root STEM on ns0",      s.naming().has(s, ns0, Grouper.PRIV_STEM)    );    Assert.assertTrue(      "root CREATE on ns0",      s.naming().has(s, ns0, Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "m0 has == 1 privs on ns0",       s.naming().has(s, ns0, m0).size() == 1    );    Assert.assertTrue(      "m0 STEM on ns0",       s.naming().has(s, ns0, m0, Grouper.PRIV_STEM)    );    Assert.assertFalse(      "m0 !CREATE on ns0",       s.naming().has(s, ns0, m0, Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "m1 has == 0 privs on ns0",       s.naming().has(s, ns0, m1).size() == 0    );    Assert.assertFalse(      "m1 !STEM on ns0",       s.naming().has(s, ns0, m1, Grouper.PRIV_STEM)    );    Assert.assertFalse(       "m1 !CREATE on ns0",      s.naming().has(s, ns0, m1, Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "ns0 has == 1 privs on ns1",       s.naming().has(s, ns1, ns0.toMember()).size() == 1    );    Assert.assertTrue(       "ns0 STEM on ns1",      s.naming().has(s, ns1, ns0.toMember(), Grouper.PRIV_STEM)    );    Assert.assertFalse(       "ns0 !CREATE on ns1",      s.naming().has(s, ns1, ns0.toMember(), Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "ns1 has == 0 privs on ns1",       s.naming().has(s, ns1, ns1.toMember()).size() == 0    );    Assert.assertFalse(       "ns1 !STEM on ns1",      s.naming().has(s, ns1, ns1.toMember(), Grouper.PRIV_STEM)    );    Assert.assertFalse(       "ns1 !CREATE on ns1",      s.naming().has(s, ns1, ns1.toMember(), Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "root has == 2 privs on ns1",       s.naming().has(s, ns1).size() == 2    );    Assert.assertTrue(      "root STEM on ns1",      s.naming().has(s, ns1, Grouper.PRIV_STEM)    );    Assert.assertTrue(      "root CREATE on ns1",      s.naming().has(s, ns1, Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "m0 has == 0 privs on ns1",       s.naming().has(s, ns1, m0).size() == 0    );    Assert.assertFalse(      "m0 !STEM on ns1",       s.naming().has(s, ns1, m0, Grouper.PRIV_STEM)    );    Assert.assertFalse(      "m0 !CREATE on ns1",       s.naming().has(s, ns1, m0, Grouper.PRIV_CREATE)    );    Assert.assertTrue(      "m1 has == 0 privs on ns1",       s.naming().has(s, ns1, m1).size() == 0    );    Assert.assertFalse(      "m1 !STEM on ns1",       s.naming().has(s, ns1, m1, Grouper.PRIV_STEM)    );    Assert.assertFalse(       "m1 !CREATE on ns1",      s.naming().has(s, ns1, m1, Grouper.PRIV_CREATE)    );    s.stop();  }