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
Map map=list.stream().collect(Collectors.toMap(Choice::getName, s->s));
Even serves this purpose for me,
Map map= list1.stream().collect(()-> new HashMap(), (r,s) -> r.put(s.getString(),s),(r,s) -> r.putAll(s));