various bug fixes

Change-Id: Id77096bd4ee2160428619b475840b36fdb5f156c
diff --git a/apps/configsync/src/main/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizer.java b/apps/configsync/src/main/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizer.java
index 344c6d0..0d48e19 100644
--- a/apps/configsync/src/main/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizer.java
+++ b/apps/configsync/src/main/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizer.java
@@ -182,6 +182,7 @@
             case NODE_ADDED:
             case NODE_REPLACED:
                 request = SetRequest.builder().replace(relPath, node).build();
+                break;
             case NODE_UPDATED:
                 // Event has no pay load, only thing we can do is replace.
                 request = SetRequest.builder().replace(relPath, node).build();
diff --git a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java
index 0728bd9..2c885e0 100644
--- a/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java
+++ b/protocols/netconf/ctl/src/main/java/org/onosproject/netconf/ctl/impl/NetconfControllerImpl.java
@@ -351,7 +351,7 @@
         @Override
         public NetconfDevice createNetconfDevice(NetconfDeviceInfo netconfDeviceInfo)
                 throws NetconfException {
-            if (NetconfSshClientLib.ETHZ_SSH2.equals(netconfDeviceInfo.sshClientLib()) ||
+            if (NetconfSshClientLib.ETHZ_SSH2.equals(netconfDeviceInfo.sshClientLib().orElse(null)) ||
                     NetconfSshClientLib.ETHZ_SSH2.equals(sshLibrary)) {
                 log.info("Creating NETCONF session to {} with {}",
                             netconfDeviceInfo.name(), NetconfSshClientLib.ETHZ_SSH2);
diff --git a/utils/misc/src/main/java/org/onlab/packet/dhcp/Dhcp6IaPrefixOption.java b/utils/misc/src/main/java/org/onlab/packet/dhcp/Dhcp6IaPrefixOption.java
index 997455d..aec7b3a 100644
--- a/utils/misc/src/main/java/org/onlab/packet/dhcp/Dhcp6IaPrefixOption.java
+++ b/utils/misc/src/main/java/org/onlab/packet/dhcp/Dhcp6IaPrefixOption.java
@@ -199,7 +199,7 @@
         if (obj == null) {
             return false;
         }
-        if (!(obj instanceof Dhcp6IaAddressOption)) {
+        if (!(obj instanceof Dhcp6IaPrefixOption)) {
             return false;
         }
         final Dhcp6IaPrefixOption other = (Dhcp6IaPrefixOption) obj;
diff --git a/utils/misc/src/test/java/org/onlab/util/ImmutableByteSequenceTest.java b/utils/misc/src/test/java/org/onlab/util/ImmutableByteSequenceTest.java
index e15065e..76981e8 100644
--- a/utils/misc/src/test/java/org/onlab/util/ImmutableByteSequenceTest.java
+++ b/utils/misc/src/test/java/org/onlab/util/ImmutableByteSequenceTest.java
@@ -17,6 +17,8 @@
 package org.onlab.util;
 
 import com.google.common.testing.EqualsTester;
+
+import org.apache.commons.lang3.RandomUtils;
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
@@ -42,9 +44,9 @@
     public void testCopy() throws Exception {
 
         byte byteValue = (byte) 1;
-        short shortValue = (short) byteValue;
-        int intValue = (int) byteValue;
-        long longValue = (long) byteValue;
+        short shortValue = byteValue;
+        int intValue = byteValue;
+        long longValue = byteValue;
         byte[] arrayValue = new byte[64];
         arrayValue[63] = byteValue;
         ByteBuffer bufferValue = ByteBuffer.allocate(64).put(arrayValue);
@@ -82,7 +84,7 @@
     @Test
     public void testEndianness() throws Exception {
 
-        long longValue = new Random().nextLong();
+        long longValue = RandomUtils.nextLong();
 
         // creates a new sequence from a big-endian buffer
         ByteBuffer bbBigEndian = ByteBuffer