How would you initialise a static Map in Java?
Map
Method one: static initialiser Method two: instance initialiser (anonymous subclass) or some other m
As usual apache-commons has proper method MapUtils.putAll(Map, Object[]):
For example, to create a color map:
Map colorMap = MapUtils.putAll(new HashMap(), new String[][] { {"RED", "#FF0000"}, {"GREEN", "#00FF00"}, {"BLUE", "#0000FF"} });