src/Bag.php
private function doCompare($collection, callable $func, callable $funcUser, callable $comparator = null)
    {
        if ($comparator) {
            return $this->createFrom($funcUser($this->items, Arr::from($collection), $comparator));
        }

        return $this->createFrom($func($this->items, Arr::from($collection)));
    }
private function doCompare($collection, callable $func, callable $funcUser, callable $comparator = null)
    {
        if ($comparator) {
            return $this->createFrom($funcUser($this->items, Arr::from($collection), $comparator));
        }

        return $this->createFrom($func($this->items, Arr::from($collection)));
    }
Do comparison with `$func`, or with `$funcUser` if `$comparator` is given.

@param iterable      $collection
@param callable      $func
@param callable      $funcUser
@param callable|null $comparator

@return static