Merge "Add helper function to check if collection is empty" am: 78e2f0d124 am: 0a62bcbc24

Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1605116

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idedfd108bac297ec564776ce237829848ebb622f
diff --git a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
index 115f19d..2223443 100644
--- a/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
+++ b/staticlibs/framework/com/android/net/module/util/CollectionUtils.java
@@ -38,6 +38,13 @@
     }
 
     /**
+     * @return True if the collection is null or 0-length.
+     */
+    public static <T> boolean isEmpty(@Nullable Collection<T> collection) {
+        return collection == null || collection.isEmpty();
+    }
+
+    /**
      * Returns an int array from the given Integer list.
      */
     @NonNull