Code example for Permissions

0
@SuppressWarnings("deprecation") 
@TestTargetClass(Identity.class)
public class IdentityTest extends TestCase {
 
    public static class MySecurityManager extends SecurityManager {
        public Permissions denied = new Permissions();
        public void checkPermission(Permission permission){
            if (denied!=null && denied.implies(permission)) throw new SecurityException();
        } 
    } 
 
    @TestTargetNew( 
        level = TestLevel.PARTIAL, 
        notes = "Method's returned variable is not checked", 
        method = "hashCode", 
        args = {} 
    ) 
    public void testHashCode() { 
        new IdentityStub("testHashCode").hashCode(); 
    }