Try this
- Read the rows from the top: the orders are sorted by due date.
- Look at the customer groups: the customer with the earliest order comes first, not the first in alphabetical order.
What you see
- Each group takes the place of its earliest order. Without keepResourceGroupOrder() the groups would be in alphabetical order.