I understand HashSet based HashSet , as they are pretty similar. This makes the code more flexible and minimizes implementation effort. However, one reference variable in the HashSet Entry seems unnecessary to me if the class prohibits the null element, so the whole record makes no sense. Despite this fact, Entry takes up 24 bytes of memory / element, while a single array with installed elements will only accept 4 bytes / element if my numbers are correct. (except array header)
If my argument is true, are the benefits really overweight with this performance?
(if I am wrong, I would learn from him)
source share