code: public CompletableFuture<Boolean> topicExistsAsync(String path) {
          EntityNameHelper.checkValidTopicName(path);
  
          CompletableFuture<Boolean> existsFuture = new CompletableFuture<>();
          this.getTopicAsync(path).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 topic exists or not.
  @param path - Path of the entity to check
  @return - True if the entity exists. False otherwise.
  @throws IllegalArgumentException - path is not null / empty / too long / invalid.