Here you can find the source of isNotEmpty(final Collection> collection)
Parameter | Description |
---|---|
collection | the collection to be tested. |
public static boolean isNotEmpty(final Collection<?> collection)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { /**//from w ww .ja va 2s . c om * Returns true if the collection is both not null and not empty; false * otherwise. * * @param collection * the collection to be tested. * @return true if the collection is both not null and not empty; false * otherwise. */ public static boolean isNotEmpty(final Collection<?> collection) { return !isEmpty(collection); } /** * Returns true if the collection is null or empty; false otherwise. * * @param collection * the collection to be tested. * @return true if the collection is null or empty; false otherwise. */ public static boolean isEmpty(final Collection<?> collection) { return collection == null || collection.isEmpty(); } }