### Question:
AllPermission extends Permission implements Serializable { public boolean implies( final Permission permission ) { if( !PermissionChecks.isJSPWikiPermission( permission ) ) { return false; } String wiki = null; if( permission instanceof AllPermission ) { wiki = ( ( AllPermission )permission ).getWiki(); } else if( permission instanceof PagePermission ) { wiki = ( ( PagePermission )permission ).getWiki(); } if( permission instanceof WikiPermission ) { wiki = ( ( WikiPermission )permission ).getWiki(); } if( permission instanceof GroupPermission ) { wiki = ( ( GroupPermission )permission ).getWiki(); } return PagePermission.isSubset( m_wiki, wiki ); } protected  AllPermission();  AllPermission( final String wiki ); boolean equals( final Object obj ); String getActions(); String getWiki(); int hashCode(); boolean implies( final Permission permission ); PermissionCollection newPermissionCollection(); String toString();  }### Answer:
@Test public void testImpliesPagePermission() { AllPermission p1 = new AllPermission( "*" ); PagePermission p2 = new PagePermission( "*:TestPage", "delete" ); Assertions.assertTrue( p1.implies( p2 ) ); Assertions.assertFalse( p2.implies( p1 ) ); p2 = new PagePermission( "myWiki:TestPage", "delete" ); Assertions.assertTrue( p1.implies( p2 ) ); Assertions.assertFalse( p2.implies( p1 ) ); p2 = new PagePermission( "*:GroupTest", "delete" ); Assertions.assertTrue( p1.implies( p2 ) ); Assertions.assertFalse( p2.implies( p1 ) ); p2 = new PagePermission( "myWiki:GroupTest", "delete" ); Assertions.assertTrue( p1.implies( p2 ) ); Assertions.assertFalse( p2.implies( p1 ) ); }
@Test public void testImpliesWikiPermission() { AllPermission p1 = new AllPermission( "*" ); WikiPermission p2 = new WikiPermission( "*", "createPages" ); Assertions.assertTrue( p1.implies( p2 ) ); Assertions.assertFalse( p2.implies( p1 ) ); p2 = new WikiPermission( "myWiki", "createPages" ); Assertions.assertTrue( p1.implies( p2 ) ); Assertions.assertFalse( p2.implies( p1 ) ); }