So , I want to make a map of Lists of Strings to Strings, but I cannot get it to work properly:
this is all the code I have done, and until i can find out why, I cannot progress:
Map<List<String>, String> test = new HashMap<List<String>, String>();
test.put( new ArrayList<String>(), "s1");
test.put( new ArrayList<String>(), "s2");
test.put( new ArrayList<String>(), "s3");
System.out.println(test.size());
i get 1, it should be 3!! Why is only one object getting added when I made 3 calls, for 3 separate objects? I know the danger of accidentally adding in the same object to a collection, but I specifically created a new ArrayList for each put, thus creating a total brand new object.
So why is there only one object in the Map then? Thanks!