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