Returns the number of elements matching the given predicate.
predicate
int count(bool Function(T)? predicate) => predicate == null ? size : where(predicate).length;