### Question:
DatabaseAccessPolicyProvider extends AbstractConfigurableAccessPolicyProvider { @Override public AccessPolicy deleteAccessPolicy(final AccessPolicy accessPolicy) throws AuthorizationAccessException { Validate.notNull(accessPolicy); final String sql = "DELETE FROM APP_POLICY WHERE IDENTIFIER = ?"; final int rowsUpdated = jdbcTemplate.update(sql, accessPolicy.getIdentifier()); if (rowsUpdated <= 0) { return null; } return accessPolicy; }  @AuthorizerContext void setDataSource(final DataSource dataSource); @AuthorizerContext void setIdentityMapper(final IdentityMapper identityMapper); @Override void doOnConfigured(final AuthorizerConfigurationContext configurationContext); @Override void preDestruction(); @Override String getFingerprint(); @Override void inheritFingerprint(String fingerprint); @Override void checkInheritability(String proposedFingerprint); @Override AccessPolicy addAccessPolicy(final AccessPolicy accessPolicy); @Override AccessPolicy updateAccessPolicy(final AccessPolicy accessPolicy); @Override Set<AccessPolicy> getAccessPolicies(); @Override AccessPolicy getAccessPolicy(final String identifier); @Override AccessPolicy getAccessPolicy(final String resourceIdentifier, RequestAction action); @Override AccessPolicy deleteAccessPolicy(final AccessPolicy accessPolicy);  }### Answer:
@Test public void testDeletePolicyWhenDoesNotExist() { configure(ADMIN_USER.getIdentity(), NIFI_IDENTITIES); final AccessPolicy policy = new AccessPolicy.Builder() .identifierGenerateRandom() .resource("/foo") .action(RequestAction.READ) .addUser("user1") .addGroup("group1") .build(); final AccessPolicy deletedPolicy = policyProvider.deleteAccessPolicy(policy); assertNull(deletedPolicy); }