code: public CompletableFuture<Boolean> ruleExistsAsync(String topicPath, String subscriptionName, String ruleName) {
          EntityNameHelper.checkValidTopicName(topicPath);
          EntityNameHelper.checkValidSubscriptionName(subscriptionName);
          EntityNameHelper.checkValidRuleName(ruleName);
  
          CompletableFuture<Boolean> existsFuture = new CompletableFuture<>();
          this.getRuleAsync(topicPath, subscriptionName, ruleName).handleAsync((qd, ex) -> {
              if (ex != null) {
                  if (ex instanceof MessagingEntityNotFoundException) {
                      existsFuture.complete(Boolean.FALSE);
                      return false;
                  }
  
                  existsFuture.completeExceptionally(ex);
                  return false;
              }
  
              existsFuture.complete(Boolean.TRUE);
              return true;
          }, MessagingFactory.INTERNAL_THREAD_POOL);
  
          return existsFuture;
      }
docs: Checks whether a given rule exists or not for a given subscription.
  @param topicPath - Path of the topic
  @param subscriptionName - Name of the subscription.
  @param ruleName - Name of the rule
  @return - True if the entity exists. False otherwise.
  @throws IllegalArgumentException - path is not null / empty / too long / invalid.