How implemented classes of Set interface maintains uniqueness in Java?

I am giving Java interviews recently and one guy asked me this question. Can anyone give a good answer on How implemented classes of Set interface maintains uniqueness in Java?