Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Copyright (c) 2014 Simon Percic
 *
 * Get the latest version from:
 * https://github.com/simonpercic/CollectionHelper
 *
 * Distributed under the MIT License, see LICENSE.txt for details
 */

import java.util.Collection;

public class Main {
    /**
     * Returns <tt>true</tt> if the collection is null or contains no elements.
     *
     * @param items collection
     * @return <tt>true</tt> if the collection is null or contains no elements
     */
    public static boolean isEmpty(Collection items) {
        return (items == null || items.size() == 0);
    }
}