Here you can find the source of isEmpty(Collection> collection)
Parameter | Description |
---|---|
collection | a parameter |
public static boolean isEmpty(Collection<?> collection)
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { /**/*from www .j av a2 s .c o m*/ * Check if the collection is empty. * * @param collection * @return */ public static boolean isEmpty(Collection<?> collection) { return collection == null || collection.size() == 0; } /** * Check if the map is empty. * * @param map * @return */ public static boolean isEmpty(Map<?, ?> map) { return map == null || map.size() == 0; } }