code: public void clear() {
          // clear out ref queue. We don't need to expunge entries
          // since table is getting cleared.
          while (queue.poll() != null)
              ;
  
          modCount++;
          Arrays.fill(table, null);
          size = 0;
  
          // Allocation of array may have caused GC, which may have caused
          // additional entries to go stale.  Removing these entries from the
          // reference queue will make them eligible for reclamation.
          while (queue.poll() != null)
              ;
      }
docs: Removes all of the mappings from this map.
  The map will be empty after this call returns.