src/Collection/IdentityWrapper.php
public function partition(Closure $p)
    {
        $array = $this->toArray();
        $this->collection->clear();
        
        foreach ($array as $key => $element) {
            $this->collection->set($key, $element);
        }
        
        $partitions = $this->collection->partition($p);
        
        return [new static($partitions[0]), new static($partitions[1])];
    }
public function partition(Closure $p)
    {
        $array = $this->toArray();
        $this->collection->clear();
        
        foreach ($array as $key => $element) {
            $this->collection->set($key, $element);
        }
        
        $partitions = $this->collection->partition($p);
        
        return [new static($partitions[0]), new static($partitions[1])];
    }
{@inheritDoc}