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