This blog of Maurice Naftalin is a great place to learn lambda expression e.g
x -> 2 * x
How does Java know which functional interface it is implementing? that information is deduced from the context. That context can be mentioned in the returnType which is known as the target type of a lambda expression
IntOperation iop = x -> x * 2;
would be a lambda for
interface IntOperation { int operate(int i); }