Java tutorial
//package com.java2s; import java.util.AbstractMap; import java.util.Collection; public class Main { public static boolean isEmpty(Collection c) { if (c == null) { return true; } return c.isEmpty(); } public static boolean isEmpty(AbstractMap map) { if (map == null) { return true; } return map.isEmpty(); } }