After Summer15 Salesforce release, the order of elements in unordered elements (Map and Set) is always the same. Previously the order was arbitrary and as a developer, you have no control on the order.
Now as you can see, with this new feature, we are trying to order the unordered elements. A little strange to me. But if you have some code snippet, where the logic depends on the ordering of the elements, then this new feature will be really helpful.
Let’s consider the below code snippet –
If you run this code after Summer15, you will get the elements in the same order every time you execute.
So now your Unordered Collections are also predictable.