code: @Override
      public Optional<XMLObject> get(final String messageID) {
          final LinkedHashMap<String, XMLObject> messages = getMessages();
          final XMLObject o = messages.get(messageID);
          if (o == null) {
              log.debug("Message {} not found in session {}", messageID, context.getSessionStore().getOrCreateSessionId(context));
              return Optional.empty();
          }
  
          log.debug("Message {} found in session {}, clearing", messageID, context.getSessionStore().getOrCreateSessionId(context));
          messages.clear();
          updateSession(messages);
          return Optional.of(o);
      }
docs: 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.
  
  @param messageID ID of message to retrieve
  @return message found or null