There are many ways to solve the same. One of the easiest ways to solve using Java 8 is given below :
As per your requirement, To sort in alphabetical order based on the map's key name
1st way :
list = list.stream()
.sorted((a,b)-> (a.get("name")).compareTo(b.get("name")))
.collect(Collectors.toList());
Or,
list = list.stream()
.sorted(Comparator.comparing(map->map.get("name")))
.collect(Collectors.toList());
2nd way :
Collections.sort(list, Comparator.comparing(map -> map.get("name")));
3rd way :
list.sort(Comparator.comparing(map-> map.get("name")));