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
List choices; // your list Map result = choices.stream().collect(Collectors.toMap(choice::getKey(),choice)); //assuming class "V" has a method to get the key, this method must handle case of duplicates too and provide a unique key.