I am trying to keep a temporary container of a class that contains member :
HashMap myobjectHashMap
A class called my
Since the OP has mentioned he does not have access to the base class inside of which exists a HashMap - I am afraid there are very few options available.
One (painfully slow and resource intensive) way of performing a deep copy of an object in Java is to abuse the 'Serializable' interface which many classes either intentionally - or unintentionally extend - and then utilise this to serialise your class to ByteStream. Upon de-serialisation you will have a deep copy of the object in question.
A guide for this can be found here: https://www.avajava.com/tutorials/lessons/how-do-i-perform-a-deep-clone-using-serializable.html