// <groupmember> implies TestGroup if Subject has GroupPermission("TestGroup")
p1 = new GroupPermission( "*:<groupmember>", "view" );
p2 = new GroupPermission ("*:TestGroup", "view" );
s = new Subject();
s.getPrincipals().add( new GroupPrincipal( "TestGroup" ) );
assertTrue( subjectImplies( s, p1, p2 ) );
// <groupmember> doesn't imply it if Subject has no GroupPermission("TestGroup")
s = new Subject();
s.getPrincipals().add( new WikiPrincipal( "TestGroup" ) );
assertFalse( subjectImplies( s, p1, p2 ) );
// <groupmember> doesn't imply it if Subject's GP doesn't match
s = new Subject();
s.getPrincipals().add( new GroupPrincipal( "FooGroup" ) );
assertFalse( subjectImplies( s, p1, p2 ) );
// <groupmember> doesn't imply it if p2 isn't GroupPermission type
p2 = new PagePermission ("*:TestGroup", "view" );
s = new Subject();
s.getPrincipals().add( new GroupPrincipal( "TestGroup" ) );
assertFalse( subjectImplies( s, p1, p2 ) );
// <groupmember> implies TestGroup if not called with Subject combiner
p1 = new GroupPermission( "*:<groupmember>", "view" );
p2 = new GroupPermission ("*:TestGroup", "view" );