I have the below code and would like to use java 8 to convert a list of Long
to a Map<Long,Long>
.
Long globalVal= 10;
List<Long> queryLongs = Arrays.asList(600L,700L,800L);
Map<Long, Long> map = queryLongs.stream().collect(Collectors.toMap(i->i, globalVal)));
I get an error when I try to map the individual value in the list as the key of the map.