@Test public void shouldConvertTheSuppliedArrayToAnIterable() throws Exception { String[] array = {"a", "b", "c"}; Iterable<String> iterable = Arrays.asIterable(array); Iterator<String> iterator = iterable.iterator(); assertThat(iterator.hasNext(), is(true)); assertThat(iterator.next(), is("a")); assertThat(iterator.hasNext(), is(true)); assertThat(iterator.next(), is("b")); assertThat(iterator.hasNext(), is(true)); assertThat(iterator.next(), is("c")); assertThat(iterator.hasNext(), is(false)); }
public static <T> Iterable<T> asIterable(T[] array) { return iterableFrom(array); }
Arrays { public static <T> Iterable<T> asIterable(T[] array) { return iterableFrom(array); } }
Arrays { public static <T> Iterable<T> asIterable(T[] array) { return iterableFrom(array); } private  Arrays(); }
Arrays { public static <T> Iterable<T> asIterable(T[] array) { return iterableFrom(array); } private  Arrays(); static List<T> asList(T[] array); static Iterable<T> asIterable(T[] array); }
Arrays { public static <T> Iterable<T> asIterable(T[] array) { return iterableFrom(array); } private  Arrays(); static List<T> asList(T[] array); static Iterable<T> asIterable(T[] array);  }