ONOS-3379: Config REST 500 errors on GET operations if keys don't exist

Change-Id: Ie32bdb70693c5571421840265b4be71d0706d797
diff --git a/utils/misc/src/main/java/org/onlab/util/Tools.java b/utils/misc/src/main/java/org/onlab/util/Tools.java
index 1b78814..ffefbfd 100644
--- a/utils/misc/src/main/java/org/onlab/util/Tools.java
+++ b/utils/misc/src/main/java/org/onlab/util/Tools.java
@@ -40,6 +40,7 @@
 import java.util.Dictionary;
 import java.util.List;
 import java.util.Random;
+import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -144,6 +145,23 @@
     }
 
     /**
+     * Returns the specified set if the set is not null and not empty;
+     * otherwise throws a not found exception.
+     *
+     * @param item set to check
+     * @param message not found message
+     * @param <T> Set item type
+     * @return item if not null and not empty
+     * @throws org.onlab.util.ItemNotFoundException if set is null or empty
+     */
+    public static <T> Set<T> emptyIsNotFound(Set<T> item, String message) {
+        if (item == null || item.isEmpty()) {
+            throw new ItemNotFoundException(message);
+        }
+        return item;
+    }
+
+    /**
      * Returns the specified item if that item is not null; otherwise throws
      * bad argument exception.
      *