code: @SuppressWarnings("unchecked")
      private LinkedHashMap<String, XMLObject> initializeSession() {
          Optional<LinkedHashMap<String, XMLObject>> messages = (Optional<LinkedHashMap<String, XMLObject>>)
                  context.getSessionStore().get(context, SAML_STORAGE_KEY);
          if (!messages.isPresent()) {
              synchronized (context) {
                  messages = (Optional<LinkedHashMap<String, XMLObject>>) context.getSessionStore().get(context, SAML_STORAGE_KEY);
                  if (!messages.isPresent()) {
                      messages = Optional.of(new LinkedHashMap<>());
                      updateSession(messages.get());
                  }
              }
          }
          return messages.get();
      }
docs: Call to the method tries to load internalMessages hashtable object from the session, if the object doesn't exist
  it will be created and stored.
  <p>
  Method synchronizes on session object to prevent two threads from overwriting each others hashtable.