Iterates a list or set in the order the cell wrote it
All 4 scenarios hold
A collection cell decides the order its parameter iterates in. Elements come out in the order the cell wrote them. They are never sorted, and never in a hash order of their own. An order-sensitive assertion against a List, Set, or Map parameter is therefore safe to write.
The elements below are text throughout, so nothing here varies the element type. The guarantee is about position, and Parameterized collection element types is where the element type is the subject.
Each rule shows the parameter's iteration as a list. A row whose input is already in ascending order proves nothing on its own. The rows that reverse or shuffle the written order are the ones that pin it down.
Both input columns hold the same elements in the same order.
| Scenario | List input | Set input | Iteration order? |
|---|---|---|---|
| Written ascending |
|
|
|
| Written descending |
|
|
|
| Written unsorted |
|
|
|
| Reverse alphabetical |
|
|
|