@Override
    public final Set<PersonAttributes> mergeResults(final Set<PersonAttributes> toModify, final Set<PersonAttributes> toConsider) {
        val toModifyPeople = new LinkedHashMap<String, PersonAttributes>();
        for (val toModifyPerson : toModify) {
            toModifyPeople.put(toModifyPerson.getName(), toModifyPerson);
        }
        for (val toConsiderPerson : toConsider) {
            val toConsiderName = toConsiderPerson.getName();
            val toModifyPerson = toModifyPeople.get(toConsiderName);

            if (toModifyPerson == null) {
                toModify.add(toConsiderPerson);
            } else {
                val toModifyAttributes = this.buildMutableAttributeMap(toModifyPerson.getAttributes());
                val mergedAttributes = this.mergePersonAttributes(toModifyAttributes, toConsiderPerson.getAttributes());
                val mergedPerson = new SimplePersonAttributes(toConsiderName, mergedAttributes);
                toModify.remove(mergedPerson);
                toModify.add(mergedPerson);
            }
        }

        return toModify;
    }
Merges the Sets of Persons additively calling the abstract {@link #mergePersonAttributes(Map, Map)} method on the
attributes of Persons that exist in both sets. The {@link #mergeAvailableQueryAttributes(Set, Set)} and {@link #mergePossibleUserAttributeNames(Set, Set)}
methods do a simple additive merge of the sets. These can be overridden by subclasses.

@author Eric Dalquist
@since 7.1.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/principal/merger/BaseAdditiveAttributeMerger.java