Hello, I have this Map in a for loop:
for (Map.Entry<String, List<String>> entry : storage.entrySet()) { sendGroupStrings(sender, entry.getValue(), entry.getKey()); }
The issue is, whenever the method sendGroupStrings() is ran, it displays the data randomly. I need to sort the data(alphabetically) in the entry map in order to display those strings properly. Now, I've already tried using a TreeMap, but I was unable to find a way to get the Key data(which is required in sendGroupStrings()) in order to make it work. However, I am open to other suggestions.
Basically, I need the data to be pulled from entry, sorted alphabetically, and then ran through sendGroupStrings().