@Override
    public void requestPermission(ApplicationId appId, Permission permission) {

        states.computeIf(appId, securityInfo -> (securityInfo == null || securityInfo.getState() != POLICY_VIOLATED),
                (id, securityInfo) -> new SecurityInfo(securityInfo.getPermissions(), POLICY_VIOLATED));
        violations.compute(appId, (k, v) -> v == null ? Sets.newHashSet(permission) : addAndGet(v, permission));
    }
@Test
    public void testRequestPermission() {
        states.compute(appId, (id, securityInfo) -> new SecurityInfo(securityInfo.getPermissions(), POLICY_VIOLATED));
        assertEquals(POLICY_VIOLATED, states.get(appId).getState());
        Permission testPermissionB = new Permission("testClassB", "testNameB");
        violations.compute(appId,
                (k, v) -> v == null ? Sets.newHashSet(testPermissionB) : addAndGet(v, testPermissionB));
        assertTrue(violations.get(appId).contains(testPermissionB));
    }