public function each(callable $consumer): int
    {
        $calls = 0;
        foreach ($this->elements as $key => $element) {
            $calls++;
            if (false === $consumer($element, $key)) {
                break;
            }
        }

        return $calls;
    }