You're adding Dollar objects to a HashSet perfectly well. You just aren't adding them to the right HashSet. See this?
Here you declare a HashSet variable named money, but you don't assign it a value. So it's null. Later in what appears to be a constructor, you do this:
Here you declare another variable named money and assign it a value. But it's a local variable whose scope is only within the constructor. It isn't the same as the class-level variable you declared earlier; that one remains null, and that's what you print later.
So what
you should do is, don't declare a local variable in the constructor. Just use the class-level variable which is already declared. Like this: