The problem is that Arrays.asList
takes a parameter of T... array
. The only applicable T
when you pass the int[]
is int[]
, as arrays of primitives will not be autoboxed to arrays of the corresponding object type (in this case Integer[]
).
So you can do Arrays.asList(new Integer[] {1, 2, 3});
.