Here you can find the source of hasElements(Collection
public static <T> boolean hasElements(Collection<T> t)
//package com.java2s; // The MIT License (MIT) import java.util.Collection; public class Main { public static <T> boolean hasElements(Collection<T> t) { return (t != null) && (t.size() > 0); }/*from w w w . ja va2s .co m*/ }