groupBy method
Items are grouped together if they meet the criteria that compares consecutive elements.
1, 2, 3, 2, 1.groupBy((a, b) => a < b) returns
[1, 2, 3, 2, 1]. In this example, items are grouped together
if they are less than the next one i.e. a < b.
Implementation
Queue<Queue<E>> groupBy(bool Function(dynamic a, dynamic b) groupFunction) {
return h
.groupByIterable(
groupFunction: groupFunction,
original: this,
)
.toNestedQueue();
}