MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

streams/SpecialCollector.java:9–19  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7
8public class SpecialCollector {
9 public static void
10 main(String[] args) throws Exception {
11 ArrayList<String> words =
12 FileToWords.stream("Cheese.dat")
13 .collect(ArrayList::new,
14 ArrayList::add,
15 ArrayList::addAll);
16 words.stream()
17 .filter(s -> s.equals("cheese"))
18 .forEach(System.out::println);
19 }
20}
21/* Output:
22cheese

Callers

nothing calls this directly

Calls 3

streamMethod · 0.95
streamMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected