public static function size(IteratorAggregate $iterable) : int
    {
        if ($iterable instanceof Countable) {
            return $iterable->count();
        }
        return Iterators::size(Iterators::from($iterable->getIterator()));
    }