I have a hashmap of a structure: Map<Integer,Set<class-object>> mymap = new HashMap<>()
In the map key is the integer and values are set of class objects
The class-object has the following variables in it
{
Integer id
String name
}
I want to sort the map in alphabetical order based on the class-object.name
variable.
How can we sort this map? Is it possible to sort such type of hashmap?