code: public static boolean serverSupportsOmemo(XMPPConnection connection, DomainBareJid server)
              throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException,
              SmackException.NoResponseException {
          return ServiceDiscoveryManager.getInstanceFor(connection)
                  .discoverInfo(server).containsFeature(PubSub.NAMESPACE);
      }
docs: Returns true, if the Server supports PEP.
  
  @param connection XMPPConnection
  @param server domainBareJid of the server to test
  @return true if server supports pep
  @throws XMPPException.XMPPErrorException
  @throws SmackException.NotConnectedException
  @throws InterruptedException
  @throws SmackException.NoResponseException