public DocumentSummary add(SummaryField field) {
        field.addDestination(name());
        if (fields.containsKey(field.getName())) {
            if ( ! fields.get(field.getName()).equals(field)) {
                throw new IllegalArgumentException("Duplicate declaration of " + field + " in " + this);
            }
        } else {
            fields.put(field.getName(), field);
        }
        return this;
    }
Adds a field to this.
The model is constrained to ensure that summary fields of the same name
in different classes have the same summary transform, because this is
what is supported by the backend currently.

@param field the summary field to add
@return this for chaining
config-model/src/main/java/com/yahoo/vespa/documentmodel/DocumentSummary.java