posted 3 years ago
The implementation is based on a hash function, which is favorable for speed. Sorting/ordering is a different concern that limits the ability to make things work fast. HashMap favors speed. If you need to preserve order, use a SortedMap implementation.