private function changeReference(Reference $reference, $serviceId)
    {
        if (method_exists($reference, 'isStrict')) {
            // Stay compatible with Symfony 2
            return new Reference($serviceId, $reference->getInvalidBehavior(), $reference->isStrict(false));
        }

        return new Reference($serviceId, $reference->getInvalidBehavior());
    }