(#22785) Add map function (copy of collect)
(#22785) Rename and update collect_spec to map_spec and use map

This updates the test to use map instead of collect.
(#22785) Deprecate the collect function (by making it raise an error)

The collect function is changed to raise an error that tells people
to update their manifests to use 'map'.

The documentation in the function also indicates the change, and
contains a note that it is reserved for future use.
(Maint) Whitespace fixup

Remove trailing whitespace.
Merge branch 'issues/issue-22785-rename-collect'

* issues/issue-22785-rename-collect:
  (Maint) Whitespace fixup
  (#22785) Deprecate the collect function (by making it raise an error)
  (#22785) Rename and update collect_spec to map_spec and use map
  (#22785) Add map function (copy of collect)