[SDFAB-933] Integrate atomix-3.1.12 and expose demote API

Additionally, this patch adds unit tests for demote and
updates a bunch of testing tools

Change-Id: I9636078b08486c9167ae253f0251f72239ad2802
diff --git a/core/api/src/main/java/org/onosproject/store/service/AsyncLeaderElector.java b/core/api/src/main/java/org/onosproject/store/service/AsyncLeaderElector.java
index b253e2a..7aee61f 100644
--- a/core/api/src/main/java/org/onosproject/store/service/AsyncLeaderElector.java
+++ b/core/api/src/main/java/org/onosproject/store/service/AsyncLeaderElector.java
@@ -144,4 +144,16 @@
     default LeaderElector asLeaderElector() {
         return asLeaderElector(DistributedPrimitive.DEFAULT_OPERATION_TIMEOUT_MILLIS);
     }
+
+    /**
+     * Attempts to demote a node to the bottom of the candidate list. It is not allowed
+     * to demote the current leader
+     *
+     * @param topic leadership topic
+     * @param nodeId identifier of node to be demoted
+     * @return CompletableFuture that is completed with a boolean when the operation is done. Boolean is true if
+     * node is now the bottom candidate. This operation can fail (i.e. return false) if the node
+     * is not registered to run for election for the topic or it is leader
+     */
+    CompletableFuture<Boolean> demote(String topic, NodeId nodeId);
 }