Use more functional idiom

Change-Id: I125dcb795b8b9dc7651a5b5891c4687368530db7
diff --git a/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java b/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java
index c150e26..e19044e 100644
--- a/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java
+++ b/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java
@@ -213,11 +213,9 @@
      */
     public Map<LinkKey, Identifier<?>> assignLabelToLinks(Set<Link> links, IntentId id, EncapsulationType type) {
 
-        Set<LinkKey> linkRequest = Sets.newHashSet();
-
-        links.forEach(link -> {
-            linkRequest.add(LinkKey.linkKey(link));
-        });
+        Set<LinkKey> linkRequest = links.stream()
+                .map(LinkKey::linkKey)
+                .collect(Collectors.toSet());
 
         Map<LinkKey, Identifier<?>> availableIds = findAvailableIDs(linkRequest, type);
         if (availableIds.isEmpty()) {