replaceFirst method
New list with first occurrence of value replaced by replacement.
Implementation
@useResult
List<T> replaceFirst(T value, T replacement) {
final List<T> out = List<T>.of(this);
final int i = indexOf(value);
if (i >= 0) out[i] = replacement;
return out;
}