public static function unserialize($serialized, string $type = null): \Closure
    {
        self::$serializeType = $type;
        $unserialized = Serialize::decode($serialized, $type);

        if (!$unserialized instanceof SerializableClosure) {
            throw new \RuntimeException(
                'The closure did not unserialize to a SuperClosure.'
            );
        }

        return $unserialized->getClosure();
    }