class ImmutableAcknowledgements implements Acknowledgements {

    @Override
    public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) {
        final Predicate<JsonField> predicate = schemaVersion.and(thePredicate);
        final JsonObject acksJsonObject =
                acknowledgementsToJsonWithDisambiguation(schemaVersion, thePredicate, Acknowledgement::toJson);
        return JsonObject.newBuilder()
                .set(JsonFields.ENTITY_ID, entityId.toString(), predicate)
                .set(JsonFields.ENTITY_TYPE, getEntityType().toString(), predicate)
                .set(JsonFields.STATUS_CODE, statusCode.toInt(), predicate)
                .set(JsonFields.ACKNOWLEDGEMENTS, acksJsonObject, predicate)
                .set(JsonFields.DITTO_HEADERS, dittoHeaders.toJson(), predicate)
                .build();
    }

    private  ImmutableAcknowledgements(final EntityIdWithType entityId,
            final Collection<? extends Acknowledgement> acknowledgements,
            final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders);

}