pipe() public method

Pass the collection to the given callback and return the result.
public pipe ( callable $callback ) : mixed
$callback callable
return mixed
 public function testPipe()
 {
     $collection = new Collection([1, 2, 3]);
     $this->assertEquals(6, $collection->pipe(function ($collection) {
         return $collection->sum();
     }));
 }