Java tutorial
//package com.java2s; import java.util.*; public class Main { /** * Retrieves the first value of a MultiMap index * @param multiMap (Map<String,LinkedList<String>>) * @param index (String) * @return String **/ public static String popMultiMap(Map<String, LinkedList<String>> multiMap, String key) { if (multiMap == null) return (null); if (multiMap.containsKey(key)) { LinkedList<String> list = multiMap.get(key); if (list != null) { return (list.pop()); } else { return (null); } } else { return (null); } } }