src/precore/util/FluentIterable.php
public function sorted(Comparator $comparator) : FluentIterable
    {
        $array = $this->toArray();
        Arrays::sort($array, $comparator);
        return self::of($array);
    }
public function sorted(Comparator $comparator) : FluentIterable
    {
        $array = $this->toArray();
        Arrays::sort($array, $comparator);
        return self::of($array);
    }
Sorts the elements in the order specified by comparator.

@param Comparator $comparator
@return FluentIterable