@Override
    public Optional<XMLObject> get(final String messageID) {
        val messages = getMessages();
        val o = messages.get(messageID);
        if (o == null) {
            LOGGER.debug("Message {} not found in session {}", messageID, sessionStore.getSessionId(context, true).orElseThrow());
            return Optional.empty();
        }

        LOGGER.debug("Message {} found in session {}, clearing", messageID, sessionStore.getSessionId(context, true).orElseThrow());
        messages.clear();
        updateSession(messages);

        return Configuration.deserializeSamlObject(o);
    }
{@inheritDoc}

Returns previously stored message with the given ID or null, if there is no message
stored.
<p>
Message is stored in String format and must be unmarshalled into XMLObject. Call to this
method may thus be expensive.
<p>
Messages are automatically cleared upon successful reception, as we presume that there
are never multiple ongoing SAML exchanges for the same session. This saves memory used by
the session.
pac4j-saml/src/main/java/org/pac4j/saml/store/HttpSessionStore.java