class SecurityPoliciesProcessDefinitionRestrictionApplier implements SecurityPoliciesRestrictionApplier<GetProcessDefinitionsPayload> {

    @Override
    public GetProcessDefinitionsPayload restrictToKeys(Set<String> keys) {
        return ProcessPayloadBuilder.processDefinitions().withProcessDefinitionKeys(keys).build();
    }

}

class SecurityPoliciesProcessDefinitionRestrictionApplierTest {

    private SecurityPoliciesProcessDefinitionRestrictionApplier restrictionApplier;

    @Test
    public void restrictToKeysAddFilterOnGivenKeys() {

        //given
        Set<String> keys = Collections.singleton("procDef");

        //when
        GetProcessDefinitionsPayload filter = restrictionApplier.restrictToKeys(keys);

        //then
        assertThat(filter.getProcessDefinitionKeys()).isEqualTo(keys);
    }

}