@Test public void testIsEmptyWithNonEmptyCollection() { final Collection<String> coll = new ArrayList<String>(); coll.add("item"); assertEquals(false, CollectionUtils.isEmpty(coll)); }
public static boolean isEmpty(final Collection<?> coll) { return coll == null || coll.isEmpty(); }
CollectionUtils { public static boolean isEmpty(final Collection<?> coll) { return coll == null || coll.isEmpty(); } }
CollectionUtils { public static boolean isEmpty(final Collection<?> coll) { return coll == null || coll.isEmpty(); } private  CollectionUtils(); }
CollectionUtils { public static boolean isEmpty(final Collection<?> coll) { return coll == null || coll.isEmpty(); } private  CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyIfNull(final Collection<T> collection); static Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> subtract(final Iterable<? extends O> a,
                                             final Iterable<? extends O> b,
                                             final Predicate<O> p); static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2); static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2); static Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll); static boolean isSubCollection(final Collection<?> a, final Collection<?> b); static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b); static boolean isEqualCollection(final Collection<?> a, final Collection<?> b); static boolean isEqualCollection(final Collection<? extends E> a,
                                                final Collection<? extends E> b,
                                                final Equator<? super E> equator); @Deprecated static int cardinality(final O obj, final Iterable<? super O> coll); @Deprecated static T find(final Iterable<T> collection, final Predicate<? super T> predicate); @Deprecated static C forAllDo(final Iterable<T> collection, final C closure); @Deprecated static C forAllDo(final Iterator<T> iterator, final C closure); @Deprecated static T forAllButLastDo(final Iterable<T> collection,
                                                                      final C closure); @Deprecated static T forAllButLastDo(final Iterator<T> iterator, final C closure); static boolean filter(final Iterable<T> collection, final Predicate<? super T> predicate); static boolean filterInverse(final Iterable<T> collection, final Predicate<? super T> predicate); static void transform(final Collection<C> collection,
                                     final Transformer<? super C, ? extends C> transformer); @Deprecated static int countMatches(final Iterable<C> input, final Predicate<? super C> predicate); @Deprecated static boolean exists(final Iterable<C> input, final Predicate<? super C> predicate); @Deprecated static boolean matchesAll(final Iterable<C> input, final Predicate<? super C> predicate); static Collection<O> select(final Iterable<? extends O> inputCollection,
                                           final Predicate<? super O> predicate); static R select(final Iterable<? extends O> inputCollection,
            final Predicate<? super O> predicate, final R outputCollection); static R select(final Iterable<? extends O> inputCollection,
            final Predicate<? super O> predicate, R outputCollection, R rejectedCollection); static Collection<O> selectRejected(final Iterable<? extends O> inputCollection,
                                                   final Predicate<? super O> predicate); static R selectRejected(final Iterable<? extends O> inputCollection,
            final Predicate<? super O> predicate, final R outputCollection); static Collection<O> collect(final Iterable<I> inputCollection,
                                               final Transformer<? super I, ? extends O> transformer); static Collection<O> collect(final Iterator<I> inputIterator,
                                               final Transformer<? super I, ? extends O> transformer); static R collect(final Iterable<? extends I> inputCollection,
            final Transformer<? super I, ? extends O> transformer, final R outputCollection); static R collect(final Iterator<? extends I> inputIterator,
            final Transformer<? super I, ? extends O> transformer, final R outputCollection); static boolean addIgnoreNull(final Collection<T> collection, final T object); static boolean addAll(final Collection<C> collection, final Iterable<? extends C> iterable); static boolean addAll(final Collection<C> collection, final Iterator<? extends C> iterator); static boolean addAll(final Collection<C> collection, final Enumeration<? extends C> enumeration); static boolean addAll(final Collection<C> collection, final C[] elements); @Deprecated static T get(final Iterator<T> iterator, final int index); @Deprecated static T get(final Iterable<T> iterable, final int index); static Object get(final Object object, final int index); static Map.Entry<K, V> get(final Map<K,V> map, final int index); static int size(final Object object); static boolean sizeIsEmpty(final Object object); static boolean isEmpty(final Collection<?> coll); static boolean isNotEmpty(final Collection<?> coll); static void reverseArray(final Object[] array); static boolean isFull(final Collection<? extends Object> coll); static int maxSize(final Collection<? extends Object> coll); static List<O> collate(Iterable<? extends O> a,
                                                                    Iterable<? extends O> b); static List<O> collate(final Iterable<? extends O> a,
                                                                    final Iterable<? extends O> b,
                                                                    final boolean includeDuplicates); static List<O> collate(final Iterable<? extends O> a, final Iterable<? extends O> b,
                                      final Comparator<? super O> c); static List<O> collate(final Iterable<? extends O> a, final Iterable<? extends O> b,
                                      final Comparator<? super O> c, final boolean includeDuplicates); static Collection<List<E>> permutations(final Collection<E> collection); static Collection<C> retainAll(final Collection<C> collection, final Collection<?> retain); static Collection<E> retainAll(final Iterable<E> collection,
                                              final Iterable<? extends E> retain,
                                              final Equator<? super E> equator); static Collection<E> removeAll(final Collection<E> collection, final Collection<?> remove); static Collection<E> removeAll(final Iterable<E> collection,
                                              final Iterable<? extends E> remove,
                                              final Equator<? super E> equator); @Deprecated static Collection<C> synchronizedCollection(final Collection<C> collection); @Deprecated static Collection<C> unmodifiableCollection(final Collection<? extends C> collection); static Collection<C> predicatedCollection(final Collection<C> collection,
                                                         final Predicate<? super C> predicate); static Collection<E> transformingCollection(final Collection<E> collection,
            final Transformer<? super E, ? extends E> transformer); static E extractSingleton(final Collection<E> collection); }
CollectionUtils { public static boolean isEmpty(final Collection<?> coll) { return coll == null || coll.isEmpty(); } private  CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyIfNull(final Collection<T> collection); static Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b); static Collection<O> subtract(final Iterable<? extends O> a,
                                             final Iterable<? extends O> b,
                                             final Predicate<O> p); static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2); static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2); static Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll); static boolean isSubCollection(final Collection<?> a, final Collection<?> b); static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b); static boolean isEqualCollection(final Collection<?> a, final Collection<?> b); static boolean isEqualCollection(final Collection<? extends E> a,
                                                final Collection<? extends E> b,
                                                final Equator<? super E> equator); @Deprecated static int cardinality(final O obj, final Iterable<? super O> coll); @Deprecated static T find(final Iterable<T> collection, final Predicate<? super T> predicate); @Deprecated static C forAllDo(final Iterable<T> collection, final C closure); @Deprecated static C forAllDo(final Iterator<T> iterator, final C closure); @Deprecated static T forAllButLastDo(final Iterable<T> collection,
                                                                      final C closure); @Deprecated static T forAllButLastDo(final Iterator<T> iterator, final C closure); static boolean filter(final Iterable<T> collection, final Predicate<? super T> predicate); static boolean filterInverse(final Iterable<T> collection, final Predicate<? super T> predicate); static void transform(final Collection<C> collection,
                                     final Transformer<? super C, ? extends C> transformer); @Deprecated static int countMatches(final Iterable<C> input, final Predicate<? super C> predicate); @Deprecated static boolean exists(final Iterable<C> input, final Predicate<? super C> predicate); @Deprecated static boolean matchesAll(final Iterable<C> input, final Predicate<? super C> predicate); static Collection<O> select(final Iterable<? extends O> inputCollection,
                                           final Predicate<? super O> predicate); static R select(final Iterable<? extends O> inputCollection,
            final Predicate<? super O> predicate, final R outputCollection); static R select(final Iterable<? extends O> inputCollection,
            final Predicate<? super O> predicate, R outputCollection, R rejectedCollection); static Collection<O> selectRejected(final Iterable<? extends O> inputCollection,
                                                   final Predicate<? super O> predicate); static R selectRejected(final Iterable<? extends O> inputCollection,
            final Predicate<? super O> predicate, final R outputCollection); static Collection<O> collect(final Iterable<I> inputCollection,
                                               final Transformer<? super I, ? extends O> transformer); static Collection<O> collect(final Iterator<I> inputIterator,
                                               final Transformer<? super I, ? extends O> transformer); static R collect(final Iterable<? extends I> inputCollection,
            final Transformer<? super I, ? extends O> transformer, final R outputCollection); static R collect(final Iterator<? extends I> inputIterator,
            final Transformer<? super I, ? extends O> transformer, final R outputCollection); static boolean addIgnoreNull(final Collection<T> collection, final T object); static boolean addAll(final Collection<C> collection, final Iterable<? extends C> iterable); static boolean addAll(final Collection<C> collection, final Iterator<? extends C> iterator); static boolean addAll(final Collection<C> collection, final Enumeration<? extends C> enumeration); static boolean addAll(final Collection<C> collection, final C[] elements); @Deprecated static T get(final Iterator<T> iterator, final int index); @Deprecated static T get(final Iterable<T> iterable, final int index); static Object get(final Object object, final int index); static Map.Entry<K, V> get(final Map<K,V> map, final int index); static int size(final Object object); static boolean sizeIsEmpty(final Object object); static boolean isEmpty(final Collection<?> coll); static boolean isNotEmpty(final Collection<?> coll); static void reverseArray(final Object[] array); static boolean isFull(final Collection<? extends Object> coll); static int maxSize(final Collection<? extends Object> coll); static List<O> collate(Iterable<? extends O> a,
                                                                    Iterable<? extends O> b); static List<O> collate(final Iterable<? extends O> a,
                                                                    final Iterable<? extends O> b,
                                                                    final boolean includeDuplicates); static List<O> collate(final Iterable<? extends O> a, final Iterable<? extends O> b,
                                      final Comparator<? super O> c); static List<O> collate(final Iterable<? extends O> a, final Iterable<? extends O> b,
                                      final Comparator<? super O> c, final boolean includeDuplicates); static Collection<List<E>> permutations(final Collection<E> collection); static Collection<C> retainAll(final Collection<C> collection, final Collection<?> retain); static Collection<E> retainAll(final Iterable<E> collection,
                                              final Iterable<? extends E> retain,
                                              final Equator<? super E> equator); static Collection<E> removeAll(final Collection<E> collection, final Collection<?> remove); static Collection<E> removeAll(final Iterable<E> collection,
                                              final Iterable<? extends E> remove,
                                              final Equator<? super E> equator); @Deprecated static Collection<C> synchronizedCollection(final Collection<C> collection); @Deprecated static Collection<C> unmodifiableCollection(final Collection<? extends C> collection); static Collection<C> predicatedCollection(final Collection<C> collection,
                                                         final Predicate<? super C> predicate); static Collection<E> transformingCollection(final Collection<E> collection,
            final Transformer<? super E, ? extends E> transformer); static E extractSingleton(final Collection<E> collection); @SuppressWarnings("rawtypes") // we deliberately use the raw type here
    static final Collection EMPTY_COLLECTION; }