Java tutorial
//package com.java2s; import java.util.Collection; public class Main { public static <E> boolean isEmpty(Collection<E> c) { return c == null || c.size() == 0; } public static <E> int size(Collection<E> c) { return c == null ? 0 : c.size(); } }