public SortedIterator getSortedIterator() {
        if (sorter != null) {
            sorter.sort(array, 0, pos / 2, sortComparator);
        }
        return new SortedIterator(pos / 2);
    }
Return an iterator over record pointers in sorted order. For efficiency, all calls to
{@code next()} will return the same mutable object.
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java