Here you can find the source of hasElements(Collection> c)
public static boolean hasElements(Collection<?> c)
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.Map; public class Main { public static boolean hasElements(Collection<?> c) { return c != null && !c.isEmpty(); }// ww w .ja v a 2s. co m public static boolean hasElements(Map<?, ?> c) { return c != null && !c.isEmpty(); } }