Exemplo n.º 1
0
 @Test
 public void works_with_multiple_types() {
   final Stream<Integer> stream = Streams.of(6, 3, 2, 7);
   assertThat(stream.foldLeft(joinAsString(), ""), is(", 6, 3, 2, 7"));
 }
Exemplo n.º 2
0
 @Test
 public void works_with_a_single_type() {
   final Stream<Integer> stream = Streams.of(6, 3, 2, 7);
   assertThat(stream.foldLeft(summation(), 0), is(18));
 }