Fixed some concurrency issues in NETCONF Session Added Unit Tests

Change-Id: I84fe0c17e3d757948a859f78d01fbb025397a44d
diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/NetconfStreamHandler.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/NetconfStreamHandler.java
index 1ee7911..98ebf3f 100644
--- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/NetconfStreamHandler.java
+++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/NetconfStreamHandler.java
@@ -29,12 +29,25 @@
     /**
      * Sends the request on the stream that is used to communicate to and from the device.
      *
+     * If this request does not contain a messageId then this will throw a NoSuchElementException
+     *
      * @param request request to send to the physical device
      * @return a CompletableFuture of type String that will contain the response for the request.
+     * @deprecated - use method with messageId parameter instead
      */
+    @Deprecated
     CompletableFuture<String> sendMessage(String request);
 
     /**
+     * Sends the request on the stream that is used to communicate to and from the device.
+     *
+     * @param request request to send to the physical device
+     * @param messageId The identifier of the message - should be unique for the session
+     * @return a CompletableFuture of type String that will contain the response for the request.
+     */
+    CompletableFuture<String> sendMessage(String request, int messageId);
+
+    /**
      * Adds a listener for netconf events on the handled stream.
      *
      * @param listener Netconf device event listener