Here you can find the source of isEmpty(Collection> collection)
public static boolean isEmpty(Collection<?> collection)
//package com.java2s; /* ******************************************************************* * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. /*from w ww. j a v a2 s .com*/ * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Xerox/PARC initial implementation * ******************************************************************/ import java.util.Collection; import java.util.Map; public class Main { /** @return ((null == s) || (0 == s.length())); */ public static boolean isEmpty(String s) { return ((null == s) || (0 == s.length())); } /** @return ((null == ra) || (0 == ra.length)) */ public static boolean isEmpty(Object[] ra) { return ((null == ra) || (0 == ra.length)); } /** @return ((null == ra) || (0 == ra.length)) */ public static boolean isEmpty(byte[] ra) { return ((null == ra) || (0 == ra.length)); } /** @return ((null == collection) || (0 == collection.size())) */ public static boolean isEmpty(Collection<?> collection) { return ((null == collection) || (0 == collection.size())); } /** @return ((null == map) || (0 == map.size())) */ public static boolean isEmpty(Map<?, ?> map) { return ((null == map) || (0 == map.size())); } }