* mapping was using a lower case name version of its original name, so we can discard that lower
* case version (the original name is still present in the map).
*/
final String oldName = nameFunction.apply(old);
if (Objects.equals(name, oldName)) {
throw new InvalidParameterCardinalityException(Errors.format(Errors.Keys.ValueAlreadyDefined_1, name), name);
}
}
/*
* Add lower-cases versions of the above element names, only if that name is not already used.
* If a name was already used, then the original mapping will have precedence.