code: private void closeDeletion(int d) {
          // Adapted from Knuth Section 6.4 Algorithm R
          Object[] tab = table;
          int len = tab.length;
  
          // Look for items to swap into newly vacated slot
          // starting at index immediately following deletion,
          // and continuing until a null slot is seen, indicating
          // the end of a run of possibly-colliding keys.
          Object item;
          for (int i = nextKeyIndex(d, len); (item = tab[i]) != null;
               i = nextKeyIndex(i, len) ) {
              // The following test triggers if the item at slot i (which
              // hashes to be at slot r) should take the spot vacated by d.
              // If so, we swap it in, and then continue with d now at the
              // newly vacated i.  This process will terminate when we hit
              // the null slot at the end of this run.
              // The test is messy because we are using a circular table.
              int r = hash(item, len);
              if ((i < r && (r <= d || d <= i)) || (r <= d && d <= i)) {
                  tab[d] = item;
                  tab[d + 1] = tab[i + 1];
                  tab[i] = null;
                  tab[i + 1] = null;
                  d = i;
              }
          }
      }
docs: Rehash all possibly-colliding entries following a
  deletion. This preserves the linear-probe
  collision properties required by get, put, etc.
  
  @param d the index of a newly empty deleted slot