public function count()
    {
        if ($this->getInnerIterator() instanceof Countable) {
            return $this->getInnerIterator()->count();
        }

        return count($this->toArray());
    }