I want to do a backup copy of a Map (that contains other Maps). I have something like this:
Map<TYPE1, Map<TYPE2, TYPE3>>
TYPE1, TYPE2 and TYPE3 are objects from 3 different classes created by me (e.g the components of that classes are: String, Integer, Double,....)
I tried
Map<TYPE1, Map<TYPE2, TYPE3>> Map2= new HashMap<TYPE1, Map<TYPE2, TYPE3>>(Map1)
[....make some changings in Map1...]
Map1 = new HashMap<TYPE1, Map<TYPE2, TYPE3>>(Map2)
Map1 is the original Map I want to make a copy of. I also tried PutAll method but it didn't work (the content of the Map isn't the same of the original one).
Do you know other methods? Thank you.