import java.util.function.Consumer; public class Foo { void f(Foo f ) { f(c -> c.getFoo()); f(c -> c.getFoo()); } void f(Consumer b){} Foo getFoo() { return this; } }