class Neg11 { void test() { class Foo { } Foo f1 = new UndeclaredName<>(); //this is deliberate: aim is to test erroneous path Foo f2 = new UndeclaredName<>() {}; //this is deliberate: aim is to test erroneous path } }