Counts elements that match the test
int countWhere(bool Function(T element) test) { int count = 0; for (final element in this) { if (test(element)) count++; } return count; }