Java tutorial
//package com.java2s; import java.util.Collection; public class Main { @SuppressWarnings("unchecked") public static boolean isNotEmpty(Collection c) { return !isEmpty(c); } @SuppressWarnings("unchecked") public static boolean isEmpty(Collection c) { return null == c || c.isEmpty(); } }