public static < T > int count ( Iterable < T > iterable ) { int count = 0 ; if ( iterable != null ) { Iterator < T > iter = iterable . iterator ( ) ; while ( iter . hasNext ( ) ) { iter . next ( ) ; count ++ ; } } return count ; }
Returns the number of elements the iterable contains .