Group consecutive equal elements together.
List<List<T>> groupList<T>(Iterable<T> it) { List<T> l = List.from(it); return groupByList((a, b) => deepEquals(a, b), l); }