1、String类型
(1)str == null;
(2)"".equals(str);
(3)str.length <= 0;
(4)str.isEmpty();
or
StringUtils.isNullOrEmpty(userId);
2、List类型
List<String> list=new ArrayList<String>();
CollectionUtils.isNotEmpty(list);
或
list != null && !list.isEmpty()//判断size()效率低
System.out.println(list.isEmpty()); //true
System.out.println(list.size()); //0
3、Map类型
Map<String, String> map=new HashMap<String, String>();
map.isEmpty()&&map.size()>0
System.out.println(map.isEmpty()); //true
System.out.println(map.size()); //0