src/Collection/IdentityWrapper.php
public function map(Closure $func)
    {
        $mapped = $this->collection->map($func);
        
        // validate mapped elements
        array_map($this->getIdentityExtractor(), $mapped->toArray());
        
        return new static($mapped);
    }
public function map(Closure $func)
    {
        $mapped = $this->collection->map($func);
        
        // validate mapped elements
        array_map($this->getIdentityExtractor(), $mapped->toArray());
        
        return new static($mapped);
    }
{@inheritDoc}