Returns the element at the specified position in an iterable. @param position position of the element to return @return the element at the specified position in iterable @throws IndexOutOfBoundsException if position is negative or greater than or equal to the size of {@code iter
(Iterable<T> iterable, int position)
| 703 | * greater than or equal to the size of {@code iterable} |
| 704 | */ |
| 705 | public static <T> T get(Iterable<T> iterable, int position) { |
| 706 | checkNotNull(iterable); |
| 707 | return (iterable instanceof List) |
| 708 | ? ((List<T>) iterable).get(position) |
| 709 | : Iterators.get(iterable.iterator(), position); |
| 710 | } |
| 711 | |
| 712 | /** |
| 713 | * Returns the element at the specified position in an iterable or a default |
no test coverage detected