List<Integer> test = List.of(955, 955);
if (test.get(1) == test.get(0))
...
Above condition results in false
List<Integer> test = List.of(955, 955);
int a = test.get(1);
int b = test.get(0);
if (a == b)
...
The above condition returns true
.
Why is that the case? What is the difference between the snippets?