Mockito verify that a specific lambda has been passed as an argument in mock's method
问题 I want to test the following method: public void dispatchMessage(MessageHandler handler, String argument1, String argument2, Long argument3) { handler.registerMessage(() -> { dispatcher.dispatch(argument1, argument2, argument3); }); } Where MessageHandler is a helper class which will accept a Functional Interface implementation in the form a lambda, and store it for later execution. Is there a way to verify with mockito that the dispatchMessage method of the mocked MessageHandler has been