code: protected final void waitForDeliverySync()
      {
      	List<AbstractSession> sessionsSnapshot = new ArrayList<>(sessions.size());
          synchronized (sessions)
          {
          	sessionsSnapshot.addAll(sessions.values());
          }
          for(int n=0;n<sessionsSnapshot.size();n++)
          {
              AbstractSession session = sessionsSnapshot.get(n);
              session.waitForDeliverySync();
          }
      }
docs: Wait for sessions to finish the current deliveridispatching