public static int size(Collection c) {
        return c != null ? c.size() : 0;
    }
Returns the size of the specified collection or {@code 0} if the collection is {@code null}.

@param c the collection to check
@return the size of the specified collection or {@code 0} if the collection is {@code null}.
@since 1.2
core/src/main/java/org/apache/shiro/util/CollectionUtils.java