Returns a Collector that accumulates the input elements into a
new List. There are no guarantees on the type, mutability,
serializability, or thread-safety of the List returned; if more
control over the returned List is required, use toCollection(Supplier).
<T> | the type of the input elements |
Collector which collects all the input elements into a
List, in encounter order
Diagram: Collectors