Esempio n. 1
0
 private void add() {
   int i = 0;
   while (i < count) {
     Random rand = new Random();
     int r = rand.nextInt(50);
     if (!hashMap.containsKey(r)) {
       hashMap.put(r, r);
       i++;
     }
   }
 }
Esempio n. 2
0
 private void remove() {
   int i = 0;
   while (i < count) {
     Random rand = new Random();
     int r = rand.nextInt(50);
     if (hashMap.containsKey(r)) {
       hashMap.remove(r);
       i++;
     }
   }
 }