int countWhere(bool Function(dynamic) predicate) { return collection.values.where(predicate).length; }