Just make a copy and it will not be changed.
Set<K> keySetCopy = new HashSet<>(map.keySet());
List<V> valuesCopy = new ArrayList<>(map.values());
All implementations of the collection have a copy constructor that copies all the data of the supplied collection to the newly created one, without being backed up by the original.
: entrySet(), - "" , . entrySet(), , .
Set<Entry<K,V>> entrySetCopy = new HashMap<>(map).entrySet();
, ONCE ( ) . , .