Map.Entry.comparingByValue() will only work if the values in the map are Comparable, and List is not Comparable. The error from the compiler is telling you that.
You need to provide a custom Comparator which knows how to sort lists by their size, e.g.
Map.Entry.comparingByValue((list1, list2) -> list1.size() - list2.size())