Aggregate List<String> into HashMap<String, T> using Stream API
问题 I have a MultivaluedMap and a list of strings, and I would like to see which of those string are keys in the MultivaluedMap . For each of the strings that are keys in the MultivaluedMap , I want to construct a new Thing out of the value of that key, set that string as a new key in a new HashMap<String, Thing> , and set the new Thing I've created as the value for that new key in the HashMap . Right now, using a vanilla forEach , I have the following working solution: MultivaluedMap<String,