Map<String, Long> map = new TreeMap<>(String. CASE_INSENSITIVE_ORDER); map. putAll(myMap); Once you’ve constructed this map, put() and get() will behave case-insensitively, so you can save and fetch values using all-lowercase keys.
How do I convert a lowercase key to a map in Java?
Map<String, Long> map = new TreeMap<>(String. CASE_INSENSITIVE_ORDER); map. putAll(myMap); Once you’ve constructed this map, put() and get() will behave case-insensitively, so you can save and fetch values using all-lowercase keys.