Better {set,map}.forEach tests.

Adapted from @DanGoldbach’s fa618397f6f09c274c72b11dcd91800456d1604a.