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)
| 761 | |
| 762 | |
| 763 | public static <T> T get(Iterable<T> iterable, int position) { |
| 764 | checkNotNull(iterable); |
| 765 | return (iterable instanceof List) |
| 766 | ? ((List<T>) iterable).get(position) |
| 767 | : Iterators.get(iterable.iterator(), position); |
| 768 | } |
| 769 | |
| 770 | /** |
| 771 | * Returns the element at the specified position in an iterable or a default |
no test coverage detected