Stop using explicit Optional#get()

Change-Id: Ifd14b02fad398d9a84c95328fcd0e8367d63cf33
diff --git a/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java
index 16bbad3..00ccd9d 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/newresource/impl/ConsistentResourceStore.java
@@ -205,9 +205,7 @@
         // Extract Discrete instances from resources
         List<Resource> resources = ids.stream()
                 .filter(x -> x.parent().isPresent())
-                .map(x -> lookup(childTxMap, x))
-                .filter(Optional::isPresent)
-                .map(Optional::get)
+                .flatMap(x -> Tools.stream(lookup(childTxMap, x)))
                 .collect(Collectors.toList());
         // the order is preserved by LinkedHashMap
         Map<DiscreteResourceId, List<Resource>> resourceMap = resources.stream()
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java
index 76709d6..3826116 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/PartitionManager.java
@@ -21,7 +21,6 @@
 import java.io.File;
 import java.util.List;
 import java.util.Map;
-import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
@@ -150,9 +149,7 @@
     public List<PartitionInfo> partitionInfo() {
         return partitions.values()
                          .stream()
-                         .map(StoragePartition::info)
-                         .filter(Optional::isPresent)
-                         .map(Optional::get)
+                         .flatMap(x -> Tools.stream(x.info()))
                          .collect(Collectors.toList());
     }
 }