assertSameItems would remove the need for sorted.