### Is there an existing issue for this?

- [X] I have searched the existing issues and read the documentation

### Question

### Issue
I deployed jar as lambda function in localstack triggered by SNS Event. I published a compressed payload to SNS topic which triggered my lambda function. During runtime, SNS Event to my lambda handler comes with message attribute by name Format Type. While extracting SNSEvent.MessageAttribute, the object is coming as LinkedHashMap and am getting an exception

### Exception Message
 Exception in thread "main" java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.amazonaws.services.lambda.runtime.events.SNSEvent$MessageAttribute (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.amazonaws.services.lambda.runtime.events.SNSEvent$MessageAttribute is in unnamed module of loader 'app')

### IDE screenshot
<img width="1104" alt="Screen Shot 2022-06-09 at 10 11 17 PM" src="https://user-images.githubusercontent.com/11893250/172999694-24a1f879-3a4f-45d4-8a94-98c325d61334.png">



### Anything else?

_No response_
import json
import queue
import random
import pytest
import requests
import xmltodict
from botocore.exceptions import ClientError
from pytest_httpserver import HTTPServer
from werkzeug import Response
from localstack import config
from localstack.constants import TEST_AWS_ACCOUNT_ID
from localstack.services.install import SQS_BACKEND_IMPL
from localstack.services.sns.provider import SNSBackend
from localstack.utils import testutil
from localstack.utils.aws import aws_stack
from localstack.utils.net import wait_for_port_closed, wait_for_port_open
from localstack.utils.strings import short_uid, to_str
from localstack.utils.sync import poll_condition, retry
from localstack.utils.testutil import check_expected_lambda_log_events_length
from .awslambda.functions import lambda_integration
from .awslambda.test_lambda import (
    LAMBDA_RUNTIME_PYTHON36,
    TEST_LAMBDA_FUNCTION_PREFIX,
    TEST_LAMBDA_LIBS,
    TEST_LAMBDA_PYTHON,
    TEST_LAMBDA_PYTHON_ECHO,
)