@Test
public void testRequestedAcknowledgementFilter() {

    // GIVEN
    final String requestedAcks = DittoHeaderDefinition.REQUESTED_ACKS.getKey();
    final AcknowledgementRequest twinPersistedAckRequest =
            AcknowledgementRequest.of(DittoAcknowledgementLabel.TWIN_PERSISTED);
    final Signal<?> signal = DeleteThing.of(ThingId.of("thing:id"), DittoHeaders.empty());
    final Signal<?> signalWithRequestedAcks = DeleteThing.of(ThingId.of("thing:id"), DittoHeaders.newBuilder()
            .acknowledgementRequest(twinPersistedAckRequest)
            .build());
    // WHEN/THEN
    final Signal<?> notFilteredSignal =
            filterAcknowledgements(signal, "fn:filter('2+2','ne','5')");
    assertThat(notFilteredSignal.getDittoHeaders()).doesNotContainKey(requestedAcks);
    final Signal<?> filteredSignal =
            filterAcknowledgements(signal, "fn:filter('2+2','eq','5')");
    assertThat(filteredSignal.getDittoHeaders()).contains(Map.entry(requestedAcks, "[]"));
    assertThatExceptionOfType(PlaceholderFunctionSignatureInvalidException.class).isThrownBy(() ->
            filterAcknowledgements(signal, "fn:filter('2','+','2','eq','5')")
    );
    final Signal<?> defaultValueSetSignal =
            filterAcknowledgements(signal, "fn:default('[\"twin-persisted\"]')");
    assertThat(defaultValueSetSignal.getDittoHeaders().getAcknowledgementRequests())
            .containsExactly(twinPersistedAckRequest);
    final Signal<?> transformedSignal =
            filterAcknowledgements(signalWithRequestedAcks, "fn:filter('2+2','eq','5')|fn:default('[\"custom\"]')");
    assertThat(transformedSignal.getDittoHeaders().getAcknowledgementRequests())
            .containsExactly(AcknowledgementRequest.parseAcknowledgementRequest("custom"));
}