Using a sorted() call and an OrderedDict to ensure the output is stable enough to test.