e.next = null;
e.next = buckets[idx]; buckets[idx] = e;
  private void rehash()  {    HashEntry[] oldBuckets = buckets;    int newcapacity = (buckets.length * 2) + 1;    threshold = (int) (newcapacity * loadFactor);    buckets = new HashEntry[newcapacity];    for (int i = oldBuckets.length - 1; i >= 0; i--)      {        HashEntry e = oldBuckets[i];        while (e != null)          {            int idx = hash(e.key);            HashEntry dest = buckets[idx];            if (dest != null)              {                while (dest.next != null)                  dest = dest.next;                dest.next = e;              }            else              buckets[idx] = e;            HashEntry next = e.next;            e.next = null;            e = next;          }      }  }