public function toArray() : array
    {
        $res = [];
        Iterators::each($this->iterator(), function ($element) use (&$res) {
            $res[] = $element;
        });
        return $res;
    }