Code example for Collection

Methods: equalsisEmpty

0
            return null; 
        } 
    } 
 
    public static boolean isCollectionEmpty(final Collection<?> collection) {
        return collection == null || collection.isEmpty();
    } 
 
    public static <T> boolean areCollectionsEqual(final Collection<T> collection1, final Collection<T> collection2) {
        return collection1 == collection2
                || (isCollectionEmpty(collection1) && isCollectionEmpty(collection2))
                || (collection1 != null && collection1.equals(collection2));
    } 
 
    public static boolean isArrayEmpty(final Object[] array) {
        return array == null || array.length == 0;
    } 
 
    public static <T> boolean areArraysEqual(final T[] array1, final T[] array2) {
        return array1 == array2
Contextual code suggestions in your IDE  Get Codota for Java