void (int i) { final Foo foo = i != 0 ? <selection>new Foo(new IBar() { public void doSomething(PrintStream out) { out.println("hello"); } })</selection> : new Foo(new IBar() { public void doSomething(PrintStream out) { out.println("hello"); } }); foo.bla(); }