public static int size(@Nullable Collection<?> collection) {
    return collection == null ? 0 : collection.size();
  }
Length of the given collection or 0 if it's null.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/ArrayUtils.java