public function stub(string $name): self
    {
        $hasStub = i\iterable_has_any($this->steps, function ($step) use ($name) {
            return $step[0] instanceof Stub && $step[0]->getName() === $name;
        });

        if ($hasStub) {
            throw new \BadMethodCallException("Pipeline builder already has '$name' stub");
        }

        return $this->then(new Stub($name));
    }