void () { doTest("java.lang.ClassCastException: class MainTest$1X cannot be cast to class java.lang.String", "Find why 'obj' could be X (not-null)", "class MainTest {static String cast(Object obj) {return (String)obj;}" + "public static void main(String[] args) { class X{}cast(new X()); }}"); }