code: private Session getSession() {
  
          if (!sessionOption.isPresent()) {
              try {
                  sessionOption = Optional.of(getConnection().createSession(transacted, acknowledgeMode));
              } catch (JMSException e) {
                  throw new JmsException("Unable to get JMS session", e);
              }
          }
          return sessionOption.get();
      }
docs: Get the current session or create one from the JMS connection.
  
  @return JMS Session