Here you can find the source of size(Collection extends Object> collection)
public static int size(Collection<? extends Object> collection)
//package com.java2s; /**/*from ww w. j a v a 2 s. co m*/ * Aptana Studio * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions). * Please see the license.html included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ import java.util.Collection; public class Main { public static int size(Collection<? extends Object> collection) { if (collection == null) { return 0; } return collection.size(); } }