private <T> Optional<T> uniquelyInherited(Function<RankProfile, T> propertyRetriever,
                                              Predicate<T> nonEmptyValueFilter,
                                              String propertyDescription) {
        Set<T> uniqueProperties = inherited().stream()
                                             .map(propertyRetriever)
                                             .filter(nonEmptyValueFilter)
                                             .collect(Collectors.toSet());
        if (uniqueProperties.isEmpty()) return Optional.empty();
        if (uniqueProperties.size() == 1) return uniqueProperties.stream().findAny();
        throw new IllegalArgumentException("Only one of the profiles inherited by " + this + " can contain " +
                                           propertyDescription + ", but it is present in multiple");
    }
Returns the property retrieved by the given function, if it is only present in a single unique variant
among all profiled inherited by this, or empty if not present.
Note that for properties that don't implement a values-based equals this reverts to the stricter condition that
only one inherited profile can define a non-empty value at all.

@throws IllegalArgumentException if the inherited profiles defines multiple different values of the property
config-model/src/main/java/com/yahoo/schema/RankProfile.java