HashMap<String,Integer> h = new HashMap<String,Integer>();To convert the keys into an ArrayList:
ArrayList<String> a = new ArrayList<String>(h.keySet());To convert the values into an ArrayList:
ArrayList<Integer> a = new ArrayList<Integer>(h.values());