Determines if the given iterable contains no elements. There is no precise Iterator equivalent to this method, since one can only ask an iterator whether it has any elements remaining (which one does using Iterator#hasNext). @return true if the iterable contains n
(Iterable<?> iterable)
| 1024 | |
| 1025 | |
| 1026 | public static boolean isEmpty(Iterable<?> iterable) { |
| 1027 | if (iterable instanceof Collection) { |
| 1028 | return ((Collection<?>) iterable).isEmpty(); |
| 1029 | } |
| 1030 | return !iterable.iterator().hasNext(); |
| 1031 | } |
| 1032 | |
| 1033 | /** |
| 1034 | * Returns an iterable over the merged contents of all given |
no test coverage detected