hashmap java get all values of key as list code example Example: Java get list of keys Hashmap List<String> l = new ArrayList<String>(map.keySet());