Hashmap could run into race condition if it would be modified by two thread simultaneous and one thread tries to resize or rehash the map because of capacity crossing threshold value. since hashmap maintains a linked list of element in bucket and while copying from one hashmap to other or old to new order of linked list got reversed, which could result in infinite loop if two threads are doing resizing at same time.