The ability to remove from a Set depends on the Object's definition of equality. For a HashSet, that would come to the combination of the Object's hashCode() and equals() methods.
So, if your Star Object has internal data which makes it unique, and you properly override the hashCode and equals methods, then you could create a NEW Star object from the same data and use that new Star to remove the old one.
For example
If your Star does have internal data, but you haven't overriden the hashCode() and equals() methods, then
you should go do that.
See
this,
this, and
this.
If the Star object does not have internal data that identifies it, then you are out of luck. In this case, your only solution would be to use a HashMap instead of a HashSet, and use the key you used to store the Star to later remove it.