Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.LinkedList; import java.util.List; import java.util.Map; public class Main { public static <K, V> List<V> extractValuesInOrder(Map<K, V> map, List<K> keysList) { List<V> vals = new LinkedList<V>(); for (K key : keysList) { vals.add(map.get(key)); } return vals; } }