class ImmutableFilteredAcknowledgementRequest implements FilteredAcknowledgementRequest {

    @Override
    public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) {

        final Predicate<JsonField> predicate = schemaVersion.and(thePredicate);

        final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder();
        jsonObjectBuilder.set(JsonFields.INCLUDES, includes.stream()
                .map(AcknowledgementRequest::getLabel)
                .map(AcknowledgementLabel::toString)
                .map(JsonFactory::newValue)
                .collect(JsonCollectors.valuesToArray()), predicate);

        if (filter != null) {
            jsonObjectBuilder.set(JsonFields.FILTER, filter, predicate);
        }
        return jsonObjectBuilder.build();
    }

    private  ImmutableFilteredAcknowledgementRequest(final Set<AcknowledgementRequest> includes,
            @Nullable final String filter);

}