SimpleGroup sg1 = new SimpleGroup("sg1");
SimpleGroup sg2 = new SimpleGroup("sg1");
sg1.addMember(sp1);
sg2.addMember(sp2);
NestableGroup ng = new NestableGroup("TestGroup");
//Add principals to the NestablePrincipal
ng.addMember(sg1);
ng.addMember(sg2);
assertTrue("ng.isMember(sp2)", ng.isMember(sp2));
//Clone the NestableGroup
NestableGroup clonedNP = (NestableGroup)ng.clone();
//Remove a group from the orig NestableGroup
ng.removeMember(sg2);
//Only the active principal is valid
assertFalse("ng.isMember(sp2) == false", ng.isMember(sp2));
assertTrue("ng.isMember(sp1)", ng.isMember(sp1));
//Check that the cloned NestablePrincipal is not affected
assertTrue("clonedNP.isMember(sp2)", clonedNP.isMember(sp2));
}