I want to translate a List of objects into a Map using Java 8\'s streams and lambdas.
This is how I would write it in Java 7 and below.
private Map&l
If your key is NOT guaranteed to be unique for all elements in the list, you should convert it to a Map> instead of a Map
Map>
Map
Map> result = choices.stream().collect(Collectors.groupingBy(Choice::getName));