In Java, how does one get the values of a HashMap returned as a List?
Assuming you have:
HashMap map; // Assigned or populated somehow.
For a list of values:
List values = new ArrayList(map.values());
For a list of keys:
List keys = new ArrayList(map.keySet());
Note that the order of the keys and values will be unreliable with a HashMap; use a LinkedHashMap if you need to preserve one-to-one correspondence of key and value positions in their respective lists.