presto-main/src/main/java/io/prestosql/operator/scalar/ArraySortComparatorFunction.java/ArraySortComparatorFunction/sortPositions
class ArraySortComparatorFunction:    private void sortPositions(int arrayLength, Comparator<Integer> comparator)
    {
        List<Integer> list = positions.subList(0, arrayLength);

        try {
            list.sort(comparator);
        }
        catch (IllegalArgumentException e) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Lambda comparator violates the comparator contract", e);
        }
    }