### Question:
WhitelistContract { void verify(Set<Permission> operations, IResource suppliedResource) { if (!suppliedResource.applicablePermissions().containsAll(operations)) { throw new InvalidRequestException(String.format("Operation(s) %s are not applicable on %s", operations, suppliedResource)); } }    }### Answer:
@Test public void testGrantSelectOnData() { contract.verify(ImmutableSet.of(Permission.SELECT), DataResource.fromName("data/ks/table")); }
@Test public void testRevokeSelectOnData() { contract.verify(ImmutableSet.of(Permission.SELECT), DataResource.fromName("data/ks/table")); }
@Test public void testGrantModifyOnData() { contract.verify(ImmutableSet.of(Permission.MODIFY), DataResource.fromName("data/ks/table")); }
@Test public void testGrantSelectAndModifyOnData() { contract.verify(ImmutableSet.of(Permission.SELECT, Permission.MODIFY), DataResource.fromName("data/ks/table")); }
@Test public void testRevokeModifyOnData() { contract.verify(ImmutableSet.of(Permission.MODIFY), DataResource.fromName("data/ks/table")); }
@Test public void testGrantExecuteOnConnections() { contract.verify(ImmutableSet.of(Permission.EXECUTE), ConnectionResource.fromName("connections")); }
@Test public void testGrantSelectOnConnections() { assertThatExceptionOfType(InvalidRequestException.class).isThrownBy(() -> contract.verify(ImmutableSet.of(Permission.SELECT), ConnectionResource.fromName("connections"))); }