docs: public AgentChatHistory getAgentHistory(EntityBareJid jid, int maxSessions, Date startDate) throws XMPPException, NotConnectedException, InterruptedException {
          AgentChatHistory request;
          if (startDate != null) {
              request = new AgentChatHistory(jid, maxSessions, startDate);
          }
          else {
              request = new AgentChatHistory(jid, maxSessions);
          }
  
          request.setType(IQ.Type.get);
          request.setTo(workgroupJID);
  
          AgentChatHistory response = connection.createStanzaCollectorAndSend(
                          request).nextResult();
  
          return response;
      }