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);  }
@Test public void addsEmptyList() { int result = com.insightfullogic.java8.answers.chapter3.Question1.addUp(Stream.empty()); assertEquals(0, result); }
@Test public void addsListWithValues() { int result = com.insightfullogic.java8.answers.chapter3.Question1.addUp(Stream.of(1, 3, -2)); assertEquals(2, result); }