Java tutorial
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { public static boolean notEmptyAndNull(Collection<?> values) { return values != null && !values.isEmpty(); } public static boolean notEmptyAndNull(Map<?, ?> values) { return values != null && !values.isEmpty(); } public static boolean notEmptyAndNull(String[] values) { return values != null && values.length != 0; } public static <T> boolean notEmptyAndNull(T[] values) { return values != null && values.length != 0; } }