Test for stable sort.
Pair should be sorted according to their first element. The second one can then be used to detect unstable sorts.
Pair should be sorted according to their first element. The second one can then be used to detect unstable sorts.