Here you can find the source of iterableSize(Iterable> iterable)
@SuppressWarnings("unused") public static int iterableSize(Iterable<?> iterable)
//package com.java2s; //License from project: Apache License public class Main { @SuppressWarnings("unused") public static int iterableSize(Iterable<?> iterable) { int result = 0; for (Object eleme : iterable) { result++;//from w ww. j av a2s .c om } return result; } }