private function deserializeEnvelope($serializedEnvelope)
    {
        $envelopeClass = $this->envelopeFactory->envelopeClass();
        $envelope = $this->objectSerializer->deserialize(
            $serializedEnvelope,
            $envelopeClass
        );

        if (!($envelope instanceof $envelopeClass)) {
            throw new \LogicException(
                sprintf(
                    'Expected deserialized object to be an instance of "%s"',
                    $envelopeClass
                )
            );
        }

        return $envelope;
    }