whereMoveToTheFront method
Moves all items that satisfy the provided test
to the start of the list.
Keeps the relative order of the moved items.
Implementation
void whereMoveToTheFront(bool Function(T item) test) {
int compare(T f1, T f2) {
bool test1 = test(f1);
return (test1 == test(f2))
? 0
: test1
? -1
: 1;
}
sortOrdered(compare);
}