Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    public static boolean isNotEmpty(Collection collection) {
        return !isEmpty(collection);
    }

    /**
     * Checks if the given array is null or its length is empty
     * 
     * @param collection
     * @return
     */
    public static boolean isEmpty(Collection collection) {
        if (collection == null)
            return true;
        if (collection.size() == 0)
            return true;
        return false;
    }
}