Use Optional.isEmpty()
[netconf.git] / netconf / netconf-util / src / main / java / org / opendaylight / netconf / util / messages / NetconfMessageUtil.java
index a32cd277b6873ca69b354b461ff3de99dcf53e76..d61b3c6d274fb625ebdf924b336f37f64ae84c64 100644 (file)
@@ -78,7 +78,7 @@ public final class NetconfMessageUtil {
         // Extract child element <capabilities> from <hello> with or without(fallback) the same namespace
         Optional<XmlElement> capabilitiesElement = responseElement
                 .getOnlyChildElementWithSameNamespaceOptionally(XmlNetconfConstants.CAPABILITIES);
-        if (!capabilitiesElement.isPresent()) {
+        if (capabilitiesElement.isEmpty()) {
             capabilitiesElement = responseElement.getOnlyChildElementOptionally(XmlNetconfConstants.CAPABILITIES);
         }