P36 { public static List<SimpleEntry<Integer, List<Integer>>> goldbach_list(IntStream range) { return range .filter(n -> n % 2 == 0) .filter(even -> even > 2) .mapToObj(even -> new SimpleEntry<>(even, P35.goldbach(even))) .collect(toList()); }  static List<SimpleEntry<Integer, List<Integer>>> goldbach_list(IntStream range); static List<SimpleEntry<Integer, List<Integer>>> goldbach_list1(IntStream range, int greaterThan);  }
@Test public void shouldProduceAListOfGoldbachCompositions() throws Exception { List<SimpleEntry<Integer, List<Integer>>> compositions = P36.goldbach_list(IntStream.rangeClosed(9, 20)); assertThat(compositions, hasSize(6)); assertThat(compositions, hasItems( new SimpleEntry<>(10, Arrays.asList(3, 7)), new SimpleEntry<>(12, Arrays.asList(5, 7)), new SimpleEntry<>(14, Arrays.asList(3, 11)), new SimpleEntry<>(16, Arrays.asList(3, 13)), new SimpleEntry<>(18, Arrays.asList(5, 13)), new SimpleEntry<>(20, Arrays.asList(3, 17)) )); }