alternative method

List<T> alternative(
  1. T main,
  2. T replace
)

New list with main removed and replace added at the end. tags.alternative("old", "new")

Implementation

List<T> alternative(T main, T replace) => toList()
  ..remove(main)
  ..add(replace);