Fixed test for sortMapToArray