Tengo un mapa Map<K, List<V>> inputMap Quiero ordenar la lista antes de almacenarla en la lista
List<String> outputList = inputMap.keySet() .stream() .filter(Objects::nonNull) .map(key -> (key + "==" + inputMap.get(key).sort(c);)) .sorted() .collect(Collectors.toList());¿Qué tal esto?
List<String> outputList = inputMap.keySet().stream() .filter(Objects::nonNull) .map(key -> key + "==" + inputMap.get(key).stream().sorted(c) .collect(Collectors.toList())) .sorted() .collect(Collectors.toList());O
List<String> outputList = inputMap.keySet().stream() .filter(Objects::nonNull) .map(key -> key + "==" + inputMap.get(key).stream().sorted(c) .map(Object::toString) .collect(Collectors.joining(", ","[","]"))) .sorted() .collect(Collectors.toList());