Returns a sequential {@link Stream} of the contents of {@code iterable}, delegating to {@link Collection#stream} if possible.
(Iterable<T> iterable)
| 64 | * Collection#stream} if possible. |
| 65 | */ |
| 66 | public static <T extends @Nullable Object> Stream<T> stream(Iterable<T> iterable) { |
| 67 | return (iterable instanceof Collection) |
| 68 | ? ((Collection<T>) iterable).stream() |
| 69 | : StreamSupport.stream(iterable.spliterator(), false); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Returns {@link Collection#stream}. |
no test coverage detected