Java examples for java.util:Map Entry
is Map Empty
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { public static void main(String[] argv) { Collection collection = java.util.Arrays.asList("asdf", "java2s.com"); System.out.println(isEmpty(collection)); }// w w w.j a v a 2s .co m public static boolean isEmpty(Collection collection) { return collection == null || collection.isEmpty(); } public static boolean isEmpty(Map map) { return map == null || map.isEmpty(); } public static boolean isEmpty(Object[] objects) { return objects == null || objects.length == 0; } }