java: unit test lambda expression inside dispatcher
问题 I have a class: public class RequestHandler implements HttpHandler { public void handleRequest(HttpServerExchange serverContext) throws Exception { serverContext.dispatch(() -> serverContext.getRequestReceiver() .receiveFullBytes((httpServerExchange, reqBytes) -> { // business logic along with few function call } ) ); } } I want to write a unit test case to test my business logic. I am not sure how to do it with 2 levels of a lambda expression insider a dispatcher? Can someone please suggest