### Question:
AuthorizationServiceImpl implements AuthorizationService, PostConstruct { @Override public boolean isPermissionGranted( final Subject subject, final Permission permission) { if ( null == subject ) { throw new IllegalArgumentException(localStrings.getLocalString("service.subject_null", "The supplied Subject is null.")); } if ( null == permission ) { throw new IllegalArgumentException(localStrings.getLocalString("service.permission_null","The supplied Permission is null.")); } Set<Principal> principalset = subject.getPrincipals(); Principal[] principalAr = (principalset.isEmpty()) ? null : principalset.toArray(new Principal[principalset.size()]); ProtectionDomain pd = new ProtectionDomain(NULL_CODESOURCE, null, null, principalAr); Policy policy = Policy.getPolicy(); boolean result = policy.implies(pd, permission); return result; }  @Override void initialize(final SecurityConfiguration securityServiceConfiguration); @Override boolean isPermissionGranted(
        final Subject subject, final Permission permission); @Override boolean isAuthorized(Subject subject, URI resource); @Override boolean isAuthorized(final Subject subject, final URI resource, final String action); @Override AzResult getAuthorizationDecision(
            final AzSubject subject,
            final AzResource resource,
            final AzAction action); @Override AzSubject makeAzSubject(final Subject subject); @Override AzResource makeAzResource(final URI resource); @Override AzAction makeAzAction(final String action); @Override PolicyDeploymentContext findOrCreateDeploymentContext(
            final String appContext); @Override void postConstruct(); @Override boolean appendAttributeResolver(AzAttributeResolver resolver); @Override void setAttributeResolvers(List<AzAttributeResolver> resolverList); @Override List<AzAttributeResolver> getAttributeResolvers(); @Override boolean removeAllAttributeResolvers();  }### Answer:
@Test public void testIsPermissionGranted() throws Exception { assertSame( "NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState() ); impl.isPermissionGranted( new Subject(), new AllPermission() ); }