int[] ints = new int[size];
long usedMemory1 = MemoryUsageUtils.getUsedMemory();
System.out.println("Benchmarking HMapII...");
MapII map = new HMapII();
startTime = System.currentTimeMillis();
for (int i = 0; i < size; i++) {
int k = r.nextInt(size);
map.put(i, k);
ints[i] = k;
}
duration = System.currentTimeMillis() - startTime;
System.out.println(" Inserting " + size + " random entries: " + duration + " ms");
startTime = System.currentTimeMillis();
for (int i = 0; i < size; i++) {
int v = map.get(i);
if (v != ints[i])
throw new RuntimeException("Values don't match!");
}
duration = System.currentTimeMillis() - startTime;