Map<String, String> map = new HashMap<String, String>();
map.put("ele1", "hello");
map.put("ele2", "world");
map.put("ele3", "java");
Set<String> set = map.keySet();
List<String> list1 = new ArrayList<String>(set);
for(int i = 0; i < list1.size(); i++){
System.out.println("list1(" + i + ") --> " + list1.get(i));
}
List<String> list2 = new ArrayList<String> ();
list2.addAll(set);
for(String elem : list2){
System.out.println(elem);
}