RATIS-1388 Add an isEmpty method to TaskQueue. (#487)

diff --git a/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java b/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java
index 767e308..9d7350c 100644
--- a/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java
+++ b/ratis-common/src/main/java/org/apache/ratis/util/TaskQueue.java
@@ -57,6 +57,13 @@
   }
 
   /**
+   * Is this queue empty?
+   */
+  public boolean isEmpty() {
+    return q.isEmpty();
+  }
+
+  /**
    * Poll the current head from this queue
    * and then submit the next head, if there is any.
    */