I have a map from List to String (keys are lists). the keys are converted from int arrays to lists. adding a pair example:
int[] arr = { 1, 2, 3, 4, 5 };
my_map.put(Arrays.asList(arr), "12345");
Now when i check if my_map contains some other list, i will always get null, example:
int[] test_arr = { 1, 2, 3, 4, 5 };
if (my_map.get(Arrays.asList(test_arr)) != null) { // always null!
// do something
}
I know what the problem is: it's comparing the addresses of the lists, and NOT the values!
How can i compare those lists values ?