Without knowing how that class is using/implementing HashMap, I would say probably not and have everything work properly without an NPE being thrown somewhere.
I had this thought as well but since we are just using the key part, I am assuming that we can totally ignore the value.
If you're using java.util.HashSet, then you don't need to worry about whether its implementation will work for you. It works for everybody else so it will work for you too.
On the other hand if you're using something else, and you're asking questions about that something else, then it would help if you would (a) say that, and (b) tell us what problem you're having with it.