private function getStoredVariation(Experiment $experiment, UserProfile $userProfile)
    {
        $experimentKey = $experiment->getKey();
        $userId = $userProfile->getUserId();
        $variationId = $userProfile->getVariationForExperiment($experiment->getId());

        if (is_null($variationId)) {
            $this->_logger->log(
                Logger::INFO,
                sprintf('No previously activated variation of experiment "%s" for user "%s" found in user profile.', $experimentKey, $userId)
            );
            return null;
        }

        if (!$this->_projectConfig->isVariationIdValid($experimentKey, $variationId)) {
            $this->_logger->log(
                Logger::INFO,
                sprintf(
                    'User "%s" was previously bucketed into variation with ID "%s" for experiment "%s", but no matching variation was found for that user. We will re-bucket the user.',
                    $userId,
                    $variationId,
                    $experimentKey
                )
            );
            return null;
        }

        $variation = $this->_projectConfig->getVariationFromId($experimentKey, $variationId);
        $this->_logger->log(
            Logger::INFO,
            sprintf(
                'Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.',
                $variation->getKey(),
                $experimentKey,
                $userId
            )
        );
        return $variation;
    }