I want to use a HashSet but worry that it “silently” absorbs duplicates (by returning true/false) but not by throwing an Exception. I’m interested in an equivalent data structure that does throw an exception (like a Dictionary would).
What’s the best approach for this?