Here you can find the source of size(Collection> col)
public static int size(Collection<?> col)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static int size(Collection<?> col) { return col == null ? 0 : col.size(); }/* w ww. ja v a2 s . c o m*/ }