So, I have a HashMap map containing ~120.000 entries. Every time a new entry comes, I check if the entry already exists in the HashMap (if(!map.containsKey(hashcode))) and if it doesn't I create a new object and put it in the HashMap.
Now my question is: Would it be better to create a boolean array NxN (with N = 6.000) and check every time if the array element in [n1][n2] is false (not in hashmap yet) or true (the pair is in HashMap), instead of using the .containsKey()?