toArraySorted