Returns the number of elements in iterable.
(Iterable<?> iterable)
| 111 | |
| 112 | |
| 113 | public static int size(Iterable<?> iterable) { |
| 114 | return (iterable instanceof Collection) |
| 115 | ? ((Collection<?>) iterable).size() |
| 116 | : Iterators.size(iterable.iterator()); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Returns {@code true} if {@code iterable} contains any object for which {@code equals(element)} |