Data structures

HashMap is container for key-value pairs LinkedHashMap keeps order of added elements

Looping through Hashmap

Map<String,LinkedList<String>> intervals = new LinkedHashMap<>() ;

// Only values
for (LinkedList<String>> iValues : intervals.values()) {
    //...do something
}

// Keys and values
for (Map.Entry<String, LinkedList<String>> entry : intervals.entrySet()) {
    String key = entrySet.getKey();
    LinkedList<String> values = entrySet.values();
}

// lambda expression
intervals.forEach((k,v) -> String key = k; LinkedList<String> values = v;//do something);