Java tutorial
//package com.java2s; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main { /** * Tabu refresh. * @param map * @param tabu * @return map/tabu */ private static Map<Integer, Integer> tabuRefresh(Map<Integer, Integer> map, List<Integer> tabu) { Map<Integer, Integer> mapCopy = new HashMap<Integer, Integer>(); for (Map.Entry<Integer, Integer> e : map.entrySet()) { Integer key = e.getKey(); Integer value = e.getValue(); if (!tabu.contains(key.intValue())) { mapCopy.put(key, value); } } return mapCopy; } }