遍历一个MAP,通过遍历的值掉查询方法,然后把值赋给一个list对象

求大神指点啊 这几句代码不知道怎么写啦。遍历一个MAP,通过遍历的值掉查询方法,然后把值赋给一个list对象

Iterator iter = map.keySet().iterator();

while (iter.hasNext()) {

key = iter.next();

value = map.get(key);

}

public static void main(String[] args) {
Map map = new HashMap();

    map.put("1", 2);
        //遍历值
    for (Object ob : map.values()) {
        System.out.println(ob.toString());
    }
}