public function reduce(callable $accumulate = null, $identity = null)
    {
        if (null === $accumulate) {
            return new Reducer($this);
        }

        $result = $identity;
        foreach ($this->elements as $key => $element) {
            $result = $accumulate($result, $element, $key);
        }

        return $result;
    }