1Collection c = new ArrayList();
2Integer obj = new Integer(1);
3c.add(obj);
4
5 // this would trigger the rule (and throw a ClassCastException if executed)
6Integer[] a = (Integer [])c.toArray();
7
8 // this is fine and will not trigger the rule
9Integer[] b = (Integer [])c.toArray(new Integer[c.size()]);
10