I need to convert a Java HashMap
to an instance of TreeMap
(including map contents)
HashMap<String, Object> src = ...;
TreeMap<String, Object> dest = src.entrySet().stream()
.filter( ... )
.collect(Collectors.toMap( ???, ???, ???, TreeMap::new));
What should I put in place of ???
to make this code compilable?
new TreeMap<>(src)
?