replaceWith method
Implementation
void replaceWith(List<T> replacement) {
var copyStart = 0;
if (replacement.length > maxLength) {
copyStart = replacement.length - maxLength;
}
final copyLength = replacement.length - copyStart;
for (var i = 0; i < copyLength; i++) {
_array[i] = replacement[copyStart + i];
}
_startIndex = 0;
_length = copyLength;
}