Iterables { public static <T> Iterable<T> concatenate(Iterable<T>... iterables) { return new ConcatenationIterable<>(Arrays.asList(iterables)); }  static Iterable<T> concatenate(Iterable<T>... iterables); static Iterable<T> take(final Iterable<T> iterable, final int elementCount);  }
@Test public void testConcatenateReturnsIterableContainingAllElementsOfTheSpecifiedIterables() { Iterable<Object> someIterable = Arrays.<Object>asList(1, 2, 3); Iterable<Object> emptyIterable = Arrays.asList(); Iterable<Object> anotherIterable = Arrays.<Object>asList(3, 2, 1); Iterable<Object> concatenatedIterable = Iterables.concatenate(someIterable, emptyIterable, anotherIterable); assertThat(concatenatedIterable, CoreMatchers.<Object>hasItems(1, 2, 3, 3, 2, 1)); }