### Question:
GroupPermission extends Permission implements Serializable { protected boolean impliesMember( Permission permission ) { if ( !( permission instanceof GroupPermission ) ) { return false; } GroupPermission gp = (GroupPermission) permission; if ( !MEMBER_TOKEN.equals( m_group ) ) { return false; } AccessControlContext acc = AccessController.getContext(); DomainCombiner dc = acc.getDomainCombiner(); if ( dc != null && dc instanceof SubjectDomainCombiner ) { Subject subject = ( (SubjectDomainCombiner) dc ).getSubject(); Set<GroupPrincipal> principals = subject.getPrincipals( GroupPrincipal.class ); for( Principal principal : principals ) { if ( principal.getName().equals( gp.m_group ) ) { return true; } } } return false; } protected  GroupPermission(); private  GroupPermission( String actions );  GroupPermission( String group, String actions ); boolean equals( Object obj ); String getActions(); String getGroup(); String getWiki(); int hashCode(); boolean implies( Permission permission ); String toString(); static final String MEMBER_TOKEN; static final String DELETE_ACTION; static final String EDIT_ACTION; static final String VIEW_ACTION; static final GroupPermission DELETE; static final GroupPermission EDIT; static final GroupPermission VIEW; }### Answer:
@Test public final void testImpliesMember() { GroupPermission p1; Permission p2; Subject s; p1 = new GroupPermission( "*:<groupmember>", "view" ); p2 = new GroupPermission ("*:TestGroup", "view" ); s = new Subject(); s.getPrincipals().add( new GroupPrincipal( "TestGroup" ) ); Assertions.assertTrue( subjectImplies( s, p1, p2 ) ); s = new Subject(); s.getPrincipals().add( new WikiPrincipal( "TestGroup" ) ); Assertions.assertFalse( subjectImplies( s, p1, p2 ) ); s = new Subject(); s.getPrincipals().add( new GroupPrincipal( "FooGroup" ) ); Assertions.assertFalse( subjectImplies( s, p1, p2 ) ); p2 = new PagePermission ("*:TestGroup", "view" ); s = new Subject(); s.getPrincipals().add( new GroupPrincipal( "TestGroup" ) ); Assertions.assertFalse( subjectImplies( s, p1, p2 ) ); p1 = new GroupPermission( "*:<groupmember>", "view" ); p2 = new GroupPermission ("*:TestGroup", "view" ); Assertions.assertFalse( p1.impliesMember( p2 ) ); }