If you know EXACTLY how much you should have, you should set the load factor to 1 and ensure that the hash maps display 1: 1. You might want to expand your container so as not to rephrase your hash.
Note that such an “exact” thing changes over time, so you might be better off with your regular container. :)
EDIT: My answer was before I realized that these are integers.
Yes, your best bet is to simply leave as you are. You will never notice the difference.
void removeDuplicates(List<Integer> list) { Set<Integer> noDupe = new HashSet<Integer>(list.size());
corsiKa
source share