Fast ArrayList or HashMap initialisation

Everyone knows how to initialize String Arrays.

But how can we do this with ArrayLists or with HashMaps?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
private static String[] array = new String[]{"Test", "Test"};

private static List<String> arraylist = new ArrayList<String>() {
{
add("Test");
add("Test");
}
};
private static Map<String,String> map = new HashMap<String,String>() {
{
put("one","Test");
put("two","Test");
}
};