Fixes unsorted dicts and sets in doctests

A few doctests were checking the values of dictionaries and sets
without sorting them in any way.  This was causing some of the
doctests to fail when the order inside the dictionary or set changed
and wasn't consistent.  Now all of the doctests check against sorted
values so the tests are consistent in their output every time.

Change-Id: I52b30327fb4acb3f1ee57ae14b611e988a43576a
Closes-Bug: 1347937
Merge "Fixes unsorted dicts and sets in doctests"