import java.util.function.*;

class Foo
{
	private int x = 0;
	
	Foo setX(int x) {
		this.x = x;
		return this;
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		Foo foo = new Foo();
		
		Consumer<Integer> setX = foo::setX;
		setX.accept(3);
		
		System.out.println(foo.x);
	}
}