bar( new class implements Bar { // ... }, ); foo(new class { });