public function checkCollection($collection, $notification, $redirectURL, $expected = 1) {

        if (null === $collection || (false === is_array($collection) && false === ($collection instanceof Countable))) {
            throw new InvalidArgumentException("The collection must be a countable");
        }
        if ($expected <= count($collection)) {
            return;
        }

        $eventName = NotificationEvents::NOTIFICATION_WARNING;

        if (null !== $this->getEventDispatcher() && true === $this->getEventDispatcher()->hasListeners($eventName)) {

            $notification = NotificationFactory::newWarningNotification($notification);
            $event        = new NotificationEvent($eventName, $notification);

            $this->getEventDispatcher()->dispatch($eventName, $event);
        }

        throw new RedirectResponseException($redirectURL, null);
    }