@Test public void addsEmptyList() { int result = com.insightfullogic.java8.answers.chapter3.Question1.addUp(Stream.empty()); assertEquals(0, result); }
public static int addUp(Stream<Integer> numbers) { return numbers.reduce(0, (acc, x) -> acc + x); }
Question1 { public static int addUp(Stream<Integer> numbers) { return numbers.reduce(0, (acc, x) -> acc + x); } }
Question1 { public static int addUp(Stream<Integer> numbers) { return numbers.reduce(0, (acc, x) -> acc + x); }  }
Question1 { public static int addUp(Stream<Integer> numbers) { return numbers.reduce(0, (acc, x) -> acc + x); }  static int addUp(Stream<Integer> numbers); static List<String> getNamesAndOrigins(List<Artist> artists); static List<Album> getAlbumsWithAtMostThreeTracks(List<Album> input); }
Question1 { public static int addUp(Stream<Integer> numbers) { return numbers.reduce(0, (acc, x) -> acc + x); }  static int addUp(Stream<Integer> numbers); static List<String> getNamesAndOrigins(List<Artist> artists); static List<Album> getAlbumsWithAtMostThreeTracks(List<Album> input);  }