posted 15 years ago
It says in the Set interface API documentation that a Set contains at most one null. It says some implementations prohibit nulls, but not which.
Suggest, maybe, you write a wrapper class around a HashSet and for all the add methods throw an Exception (probably NullPointerException) if the element is null.