Is there a good way to have a Map<String, ?> get and put ignoring case? [duplicate]
This question already has an answer here: Case insensitive string as HashMap key 12 answers Is there a good way to have a Map<String, ?> get and put ignoring case? TreeMap extends Map and supports custom comparators. String provides a default case insensitive comparator. So: final Map<String, ...> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); The comparator does not take locale into account. Read more about it in its JavaDoc. You could use CaseInsensitiveMap from Apache's Commons Collections. Guido Would it be possible to implement your own Map overriding put/get methods ? public class