If you want to assign a complex class (such as a HashMap / ArrayList etc) as a constant in Java, use the static initializer block construct :
import java.util.ArrayList;
import java.util.HashMap;
public class MyConstants {
public final static HashMap myHashMap = new HashMap();
static {
myHashMap.put("key1", "value1");
myHashMap.put("key2", "value2");
myHashMap.put("key3", "value3");
}
public final static ArrayList myArrayList = new ArrayList();
static {
myArrayList.add("value4");
myArrayList.add("value5");
myArrayList.add("value6");
}
}