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