protected function assertIterable($subject, $msg): void
    {
        $iterable = function_exists('is_iterable')
            ? is_iterable($subject)
            : is_array($subject) || $subject instanceof Traversable;
        
        if (!$iterable) {
            throw new InvalidArgumentException($msg);
        }
    }