I have a question for the following code in the best answer on this page:
return people
.filter( p -> p.age() < 19)
.collect(toList());
Where is the implementation of toList()
? java.util.stream.Collectors.toList()
? I don't understand why toList()
can be here. How does it works?