Home / Report Question

Q. What is the correct way to collect elements into a `SortedMap`?
  • A. Collectors.toMap(..., ..., TreeMap::new)
  • B. Collectors.groupingBy(..., SortedMap::new)
  • C. Collectors.toSortedMap()
  • D. Collectors.mapping(TreeMap::new)