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                       );    // Create g0    GrouperGroup g0  = GrouperGroup.create(                         s, Constants.g0s, Constants.g0e                       );    // Create g1    GrouperGroup g1  = GrouperGroup.create(                         s, Constants.g1s, Constants.g1e                       );    // Load m0    GrouperMember m0 = GrouperMember.load(                         s, Constants.mem0I, Constants.mem0T                       );    // Load m1    GrouperMember m1 = GrouperMember.load(                         s, Constants.mem1I, Constants.mem1T                       );    // Grant m0 ADMIN on g0    Assert.assertTrue(      "grant m0 ADMIN on g0",       s.access().grant(s, g0, m0, Grouper.PRIV_ADMIN)    );    // Grant g0 ADMIN on g1    Assert.assertTrue(      "grant g0 ADMIN on g1",       s.access().grant(s, g1, g0.toMember(), Grouper.PRIV_ADMIN)    );    // Assert privileges    Assert.assertTrue(      "g0 has == 0 privs on g0",       s.access().has(s, g0, g0.toMember()).size() == 0    );    Assert.assertFalse(       "g0 !ADMIN on g0",      s.access().has(s, g0, g0.toMember(), Grouper.PRIV_ADMIN)    );    Assert.assertFalse(       "g0 !UPDATE on g0",      s.access().has(s, g0, g0.toMember(), Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "g1 has == 0 privs on g0",       s.access().has(s, g0, g1.toMember()).size() == 0    );    Assert.assertFalse(       "g1 !ADMIN on g0",      s.access().has(s, g0, g1.toMember(), Grouper.PRIV_ADMIN)    );    Assert.assertFalse(       "g1 !UPDATE on g0",      s.access().has(s, g0, g1.toMember(), Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "root has == 6 privs on g0",       s.access().has(s, g0).size() == 6    );    Assert.assertTrue(      "root ADMIN on g0",      s.access().has(s, g0, Grouper.PRIV_ADMIN)    );    Assert.assertTrue(      "root UPDATE on g0",      s.access().has(s, g0, Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "m0 has == 1 privs on g0",       s.access().has(s, g0, m0).size() == 1    );    Assert.assertTrue(      "m0 ADMIN on g0",       s.access().has(s, g0, m0, Grouper.PRIV_ADMIN)    );    Assert.assertFalse(      "m0 !UPDATE on g0",       s.access().has(s, g0, m0, Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "m1 has == 0 privs on g0",       s.access().has(s, g0, m1).size() == 0    );    Assert.assertFalse(      "m1 !ADMIN on g0",       s.access().has(s, g0, m1, Grouper.PRIV_ADMIN)    );    Assert.assertFalse(       "m1 !UPDATE on g0",      s.access().has(s, g0, m1, Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "g0 has == 1 privs on g1",       s.access().has(s, g1, g0.toMember()).size() == 1    );    Assert.assertTrue(       "g0 ADMIN on g1",      s.access().has(s, g1, g0.toMember(), Grouper.PRIV_ADMIN)    );    Assert.assertFalse(       "g0 !UPDATE on g1",      s.access().has(s, g1, g0.toMember(), Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "g1 has == 0 privs on g1",       s.access().has(s, g1, g1.toMember()).size() == 0    );    Assert.assertFalse(       "g1 !ADMIN on g1",      s.access().has(s, g1, g1.toMember(), Grouper.PRIV_ADMIN)    );    Assert.assertFalse(       "g1 !UPDATE on g1",      s.access().has(s, g1, g1.toMember(), Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "root has == 6 privs on g1",       s.access().has(s, g1).size() == 6    );    Assert.assertTrue(      "root ADMIN on g1",      s.access().has(s, g1, Grouper.PRIV_ADMIN)    );    Assert.assertTrue(      "root UPDATE on g1",      s.access().has(s, g1, Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "m0 has == 0 privs on g1",       s.access().has(s, g1, m0).size() == 0    );    Assert.assertFalse(      "m0 !ADMIN on g1",       s.access().has(s, g1, m0, Grouper.PRIV_ADMIN)    );    Assert.assertFalse(      "m0 !UPDATE on g1",       s.access().has(s, g1, m0, Grouper.PRIV_UPDATE)    );    Assert.assertTrue(      "m1 has == 0 privs on g1",       s.access().has(s, g1, m1).size() == 0    );    Assert.assertFalse(      "m1 !ADMIN on g1",       s.access().has(s, g1, m1, Grouper.PRIV_ADMIN)    );    Assert.assertFalse(       "m1 !UPDATE on g1",      s.access().has(s, g1, m1, Grouper.PRIV_UPDATE)    );    s.stop();  }