Main.java:21: error: no suitable method found for toArray(int[])
return (int[])primes.toArray(new int[primes.size()]);
^
method List.<T>toArray(T[]) is not applicable
(inferred type does not conform to declared bound(s)
inferred: int
bound(s): Object)
method List.toArray() is not applicable
(actual and formal argument lists differ in length)
where T is a type-variable:
T extends Object declared in method <T>toArray(T[])
1 error