To make things work you need to use Integer[]
instead of int[]
.
Argument of asList
is of type T...
and generic types T
can't represent primitive types int
, so it will represent most specific Object class, which in this case is array type int[]
.
That is why Arrays.asList(arrs);
will try to return List<int[]>
instead of List<int>
or even List<Integer>
.
Some people expect automatic conversion from int[]
to Integer[]
, but lets nor forget that autoboxing works only for primitive types, but arrays are not primitive types.