I want to achieve the below snippet using java 8 streams.Any answers would be appreciable.I need to set different values for the same key 'amount'.so that i am creating new hashmap inside a loop.It will be like [{amount=100},{amount=200}].
List<String> data = Arrays.asList('', '', '');
List<Map<String,Object> finalList = new ArrayList();
for(String dataIterate : data) {
Map<String,Object> map = new HashMap();
map.put("amount",dataIterate);
finalList.add(map);
}