I struggle with the definition and usage of the
Stream.collect(Supplier supplier, BiConsumer accumulator, BiConsumer comb
ArrayList::add actually has 2 parameters. The ArrayList object on which you call the add method and the parameter to add.
ArrayList::add
ArrayList
add
ArrayList::add is equivalent to (list, element) -> list.add(element) and so it works as a BiConsumer
(list, element) -> list.add(element)
BiConsumer