If you are looking deep copy of your previous map use copy constructor, clone is a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
If you want shallow copy of your previous map you could use pass the map reference to your new map constructor
rather than clone
method.
HashMap<String,Integer> map2= new HashMap<>(map);
There are annoyance over clone method find SO.
Josh Bloch on Design - Copy Constructor versus Cloning
If you've read the item about cloning in my book, especially if you
read between the lines, you will know that I think clone is deeply
broken. [...] It's a shame that Cloneable is broken, but it happens.