1、判断列表l坡纠课柩ist为空的方法:publicstaticbooleanisEmptyList(Collection<稆糨孝汶;?>collection){returncollection==null||collection.isEmpty();}Collection一个集合框架来的 也是一个集合接口 通过属性isEmpty()来判断有没有数据
2、判断Map为空的方法:publicstaticbooleanisEmptyMap(Map<?,?>map){returnmap==null||isEmptyList(map.keySet());}Map 是一个键值对映射的集合接口 通过map.keySet()方法来返回一个set再判断它是否为空