code: protected function getTaxGroupFromEvent(ResourceEventInterface $event)
      {
          $resource = $event->getResource();
  
          if (!$resource instanceof TaxGroupInterface) {
              throw new InvalidArgumentException('Expected instance of ' . TaxGroupInterface::class);
          }
  
          return $resource;
      }
docs: Returns the tax group from the event.
  
  @param ResourceEventInterface $event
  
  @return TaxGroupInterface
  @throws InvalidArgumentException