replaceOrAdd method
Implementation
void replaceOrAdd(ReplaceValidator<T> validator, T value) {
if (!replaceWhere(validator, (e) => value)) add(value);
}
void replaceOrAdd(ReplaceValidator<T> validator, T value) {
if (!replaceWhere(validator, (e) => value)) add(value);
}