public static <E> Stream<E> toStream(Iterable<E> iterable) {
        checkNotNull(iterable);

        return iterable instanceof Collection
                ? ((Collection<E>) iterable).stream()
                : StreamSupport.stream(iterable.spliterator(), false);
    }
@Test
    void testToStream() {
        Queue<Integer> deque = new ArrayDeque<>();
        testIterable.forEach(deque::add);

        Stream<Integer> stream = IterableUtils.toStream(testIterable);
        assertThat(stream.allMatch(value -> deque.poll().equals(value))).isTrue();
    }