You pass a block of code to a collection's method, and this block is executed for every array element:
myArray do: [ :element| element modifyAsNeeded]
A variation I used in my cheating implementation was:
randomNumbers groupedBy: [:number | (number / increment) truncated]
This produces a dictionary of sets that has integers as keys, and set of all numbers that produced that integer in the block as vaules.