The reason this doesn't work is that you have already assigned a type to your lambda expression.
Consider this example:
acceptConsumer(card -> {});
Here, the compiler can check what the type of the argument is supposed to be. Since the lambda provided is a legal representation of that argument type, all is well.
Compare this to your example:
OnHandCardAddedListener viewCardConsumer = card -> { };
acceptConsumer(viewCardConsumer); // does not compile
Here you are not passing a lambda to the method, but a totally different type than is expected. The fact that you use a lambda expression to initialize viewCardConsumer
is completely irrelevant. This code is equivalent to the following code which I don't think you would expect to compile:
OnHandCardAddedListener viewCardConsumer = new OnHandCardAddedListener() {
@Override
void onCardAdded(final Card card){ };
};
acceptConsumer(viewCardConsumer); // does not compile either