Returns the single element contained in iterable. @throws NoSuchElementException if the iterable is empty @throws IllegalArgumentException if the iterable contains multiple elements
(Iterable<T> iterable)
| 294 | * elements |
| 295 | */ |
| 296 | public static <T> T getOnlyElement(Iterable<T> iterable) { |
| 297 | return Iterators.getOnlyElement(iterable.iterator()); |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * Returns the single element contained in {@code iterable}, or {@code |
no test coverage detected