private function validateReferenceArgument($className, Reference $reference)
{
// the __toString method of a Reference is the referenced service id
$referencedServiceId = (string) $reference;
$definition = $this->containerBuilder->findDefinition($referencedServiceId);
// we don't have to check if the definition exists, since the ContainerBuilder itself does that already
$this->validateDefinitionArgument($className, $definition);
}