@Test public void flattenWithTrailingInfiniteStream() throws Exception {

  Stream<Integer> flattened =
      MoreStreams.flatten(Stream.of(Stream.of(1), Stream.iterate(2, i -> i + 1)));
  assertThat(flattened.limit(5).collect(toList()))
      .containsExactly(1, 2, 3, 4, 5).inOrder();
}