Java 8 has been out for some time. Impress your teacher with this:
list = list.stream()
.sorted((m1, m2) -> Integer.compare(m2.get("count"),m1.get("count")))
.collect(Collectors.toList());
Here's some test code:
List<Map<String, Integer>> list = new ArrayList<Map<String, Integer>>() {{
add(new HashMap<String, Integer>() {{put("id",45964953); put("count", 1);}});
add(new HashMap<String, Integer>() {{put("id",46009636); put("count", 1);}});
add(new HashMap<String, Integer>() {{put("id",45936991); put("count", 1);}});
add(new HashMap<String, Integer>() {{put("id",45984035); put("count", 2);}});
add(new HashMap<String, Integer>() {{put("id",45951961); put("count", 1);}});
add(new HashMap<String, Integer>() {{put("id",45399668); put("count", 31);}});
}};
list = list.stream().sorted((m1, m2) -> Integer.compare(m2.get("count"), m1.get("count"))).collect(Collectors.toList());
System.out.println(list);
Output:
[{count=31, id=45399668}, {count=2, id=45984035}, {count=1, id=45964953}, {count=1, id=46009636}, {count=1, id=45936991}, {count=1, id=45951961}]