private static void validateAttributePredicate(ClusterSpec.Id id,
                                                   Attribute currentAttr, Attribute nextAttr,
                                                   Predicate<Attribute> predicate, String setting,
                                                   List<VespaConfigChangeAction> result) {
        boolean nextValue = predicate.test(nextAttr);
        if (predicate.test(currentAttr) != nextValue) {
            String change = nextValue ? "add" : "remove";
            result.add(new VespaRestartAction(id, new ChangeMessageBuilder(nextAttr.getName()).addChange(change + " attribute '" + setting + "'").build()));
        }
    }
Validates the changes between the current and next set of attribute fields in a document database.

@author geirst
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java