I don’t know what you really want to archive but why using a Hashmap? You could put the reference to the MaxBox-Instance in myObject as field and store the instances of myObject in something that implements the List Interface, like ArrayMap. In case of a HashMap what would be your key (I guess the values will be the myObjects) ?.
What would be the benefits to use ArrayMap over HashMap ?
Indeed, I can store the ref inside the object itself.
Actually the key was a number incremented each time I created on MaxBox and, this is an important value because I’m instantiating my MaxBox (basically pre-made abstractions) with that value as argument, propagating inside the abstraction by #1 ..