How do we unit test this lambda expression?
<p>We have a REST end point (JAX-RS) that is invoked from the browser. We are passing around OutputStream so that we could have the browser display the result of the call. </p>

<p>Here is the method.</p>

<pre><code>@Path("/mypath/{userId}")
@POST
public Response createUser(@PathParam("userId") final int userId ) {
    StreamingOutput stream = (outputStream) -&gt; {
        User user = userHelper.findUser(userId);
        userHelper.updateUser(user,outputStream);
    };

    return Response.ok(stream).build();
}
</code></pre>

<p><strong>Using Junit and Mockito, how do we verify if <code>userHelper.findUser</code> and <code>userHelper.updateUser</code> has been called</strong> ? </p>

<p>Basically we just want to verify the interactions.</p>