Class CollectionUtils


  • public final class CollectionUtils
    extends Object
    Collection Utilities
    Author:
    Brian Wyka
    • Method Detail

      • isEmpty

        public static <T> boolean isEmpty​(Collection<T> collection)
        Determine if the collection is empty (null or has zero elements)
        Type Parameters:
        T - the type of the elements in the collection
        Parameters:
        collection - the collection to check
        Returns:
        true if empty, false otherwise
      • isNotEmpty

        public static <T> boolean isNotEmpty​(Collection<T> collection)
        Determine if the collection is NOT empty (has at least one element)
        Type Parameters:
        T - the type of the elements in the collection
        Parameters:
        collection - the collection to check
        Returns:
        true if NOT empty, false otherwise