Java tutorial
//package com.java2s; import java.util.Collection; public class Main { /** * * @Title: isEmpty * @author: wuwh * * <p>check collection is empty</p> * * <pre> * CollectionUtil.isEmpty(null) = true * Map.put("ddd","ddd"); * CollectionUtil.isEmpty(Map)=false * </pre> * */ public static boolean isEmpty(Collection collection) { return null != collection && !collection.isEmpty() ? false : true; } }