Which collector would be best to collect elements into a `TreeSet`?
Correct answer
Collectors.toCollection(TreeSet::new)
Explanation
`Collectors.toCollection(TreeSet::new)` is used to collect elements into a TreeSet.
By Ram Sharma · · 24 views