class Bar { void f() {} private static void foo(Bar bar) { bar.f(); Runnable r = bar::f; } }