code: public boolean supportsFlexibleRetrieval() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
          return ServiceDiscoveryManager.getInstanceFor(connection).serverSupportsFeature(namespace);
      }
docs: Returns true if the server supports Flexible Offline Message Retrieval. When the server
  supports Flexible Offline Message Retrieval it is possible to get the header of the offline
  messages, get specific messages, delete specific messages, etc.
  
  @return a boolean indicating if the server supports Flexible Offline Message Retrieval.
  @throws XMPPErrorException If the user is not allowed to make this request.
  @throws NoResponseException if there was no response from the server.
  @throws NotConnectedException
  @throws InterruptedException