public function diff(CollectionInterface $other): CollectionInterface
    {
        if (!$other instanceof static) {
            throw new CollectionMismatchException('Collection must be of type ' . static::class);
        }

        $comparator = function ($a, $b) {
            return $a === $b ? 0 : -1;
        };

        $diffAtoB = \array_udiff($this->data, $other->data, $comparator);
        $diffBtoA = \array_udiff($other->data, $this->data, $comparator);

        return new static(\array_merge($diffAtoB, $diffBtoA));
    }