You can use CaseInsensitiveMap<K,V> instead of Map<K,V>
It extends AbstractHashedMap<K,V> and ignores key case. You can create a new instance of this card by transferring the existing card to the case-sensitive constructor.
Consider the following example:
Map<String, String> map = new CaseInsensitiveMap<String, String>(); map.put("One", "One"); map.put("Two", "Two"); map.put(null, "Three"); map.put("one", "Four");
The map will contain three elements:
<one, "Four"> <two, "Two"> <null, "Three">
Infact map.put("one", "Four") overwrites the insertion of map.put("One", "One") values map.put("One", "One") .
map.get(null) returns "Three".
map.get("ONE") , map.get("ONE") , map.get("ONE") , etc. returns "Four."
Keep in mind that the keySet() method returns all lowercase keys or zeros.
keySet() is equal to {"one", "two", null} .
Additional documentation