Customer/EventListener/CustomerGroupListener.php
protected function getCustomerGroupFromEvent(ResourceEventInterface $event)
    {
        $resource = $event->getResource();

        if (!$resource instanceof CustomerGroupInterface) {
            throw new InvalidArgumentException('Expected instance of ' . CustomerGroupInterface::class);
        }

        return $resource;
    }
protected function getCustomerGroupFromEvent(ResourceEventInterface $event)
    {
        $resource = $event->getResource();

        if (!$resource instanceof CustomerGroupInterface) {
            throw new InvalidArgumentException('Expected instance of ' . CustomerGroupInterface::class);
        }

        return $resource;
    }
Returns the customer group from the event.

@param ResourceEventInterface $event

@return CustomerGroupInterface
@throws InvalidArgumentException