/** @return the ZooKeeper path used for leadership election by Curator */
  private String buildLeaderPath() {

    String ns = StringUtils.hasText(namespace) ? namespace : DEFAULT_NAMESPACE;
    if (!ns.startsWith("/")) {
      ns = "/" + ns;
    }
    if (!ns.endsWith("/")) {
      ns = ns + "/";
    }
    return String.format(ns + "%s", candidate.getRole());
  }