public function validate($plugin)
{
if (!$plugin instanceof $this->instanceOf) {
throw new InvalidServiceException(sprintf('Plugin of type "%s" is invalid; must implement %s', is_object($plugin) ? get_class($plugin) : gettype($plugin), $this->instanceOf));
}
}