public function collect(Collector $collector = null)
    {
        if (null === $collector) {
            return new Collectors($this);
        }

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

        return $collector->finish();
    }