[Solved] Create a map with values of one map as key and values of each map as values from a list of maps [closed]
You want something like this: List<Map<String, String>> result = four.stream() // iterate the Map with values .map(map -> map.entrySet() // .. for each one .stream() // .. stream and collect .collect(Collectors.toMap( // .. into a new Map e -> one.get(e.getKey()), // .. with a key from the `one` Map Map.Entry::getValue))) // .. and the same … Read more