class ImmutableReplyTarget implements ReplyTarget {

    @Override
    public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> predicate) {
        final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder();
        jsonObjectBuilder.set(JsonFields.ADDRESS, address);
        if (headerMapping != null) {
            jsonObjectBuilder.set(JsonFields.HEADER_MAPPING, headerMapping.toJson(schemaVersion, predicate),
                    predicate);
        }
        jsonObjectBuilder.set(JsonFields.EXPECTED_RESPONSE_TYPES, expectedResponseTypes.stream()
                .map(ResponseType::getName)
                .map(JsonFactory::newValue)
                .collect(JsonCollectors.valuesToArray()));
        return jsonObjectBuilder.build();
    }

    private  ImmutableReplyTarget(final Builder builder);

}