Say I want to add duplicate element in HashSet. We know that is not allowed. So I came across 2, let's say theories.
Under 'PROPERTIES, number 2' of this link, it says:
HashSet does not allow duplicate elements. If you try to insert a duplicate element, older element will be overwritten
But when I check docs that are provided to me in IDE, in method add(), it states:
* If this set already contains the element, the call leaves the set * unchanged and returns {@code false}.
So does it overwrite(replace) old element or it leaves the set unchanged and returns false? :) Am I crazy of they say exactly the opposite?