I have the first key/value pair in a LinkedHashMap, which I get from a loop:
for (Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
//put key value to use
break;
}
Later on, based on an event, I need the next key/value pair in the linkedHashMap. What is the best way to do this?