code: public ExtWebDriver getCurrentSession(boolean createIfNotFound) {
  
          for (int i = 0; i < MAX_RETRIES; i++) {
              ExtWebDriver sel = sessions.get(currentSessionId);
              try {
                  if ((sel == null) && (createIfNotFound)) {
                      sel = getNewSession();
                  }
                  return sel;
              } catch (Exception e) {
                  // if the exception is of type UnreachableBrowserException, try
                  // again
                  if (!(e instanceof UnreachableBrowserException)) {
                      e.printStackTrace();
                  }
              }
          }
          return null;
      }
docs: Get the current session associated with this thread. Because a
  SessionManager instance is thread-local, the notion of current is also
  specific to a thread.
  
  
  @param createIfNotFound
  set to true if a session should be created if no session is
  associated with the current sessionId
  @return ExtWebDriver an ExtWebDriver instance
  @see getCurrentSession()
  @see getSession(String)
  @see switchToSession(String)