Here you can find the source of size(final Collection
public static <T> int size(final Collection<T> items)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static <T> int size(final T[] items) { return items.length; }/*from ww w . j a va 2 s. co m*/ public static <T> int size(final Collection<T> items) { return items.size(); } }