I have this Java Map:
Can you tell me how I can get the 6-th element of the Map?
private static final Map cache = new HashMap<
Use LinkedHashMap instead of HashMap It will return keys in same order (as insertion) when calling keySet().
For mare detail about LinkedHashMap see this
For example to get the element from specific index
Create a new list from your values and get the value based on index.
LinkedHashMap> hMap;
List> l = new ArrayList>(hMap.values());
l.get(6);