1.HashMap is not thread safe.
2. It will happen when put or resize, the data operated by the latter thread will overwrite the data operated by the previous thread, or the data will be lost.
The explanation comes from here: https://www.cnblogs.com/FirstClass/p/6501290.html