void () { doTest(""" import java.util.*; class Test { static class X<T> extends ArrayList<Integer> {} Integer[] test(X<Double> x) { return x.toArray(new Integer[0]); } Double[] test2(X<Double> x) { return x.toArray(/*Array of type 'java.lang.Integer[]' expected, 'java.lang.Double[]' found*/new Double[0]/**/); } }"""); }