title: Mock method with Consumer
body: <p>I want to mock <code>repository.actionOnFile(String path, Consumer&lt;InputStream&gt; action)</code> in this source:</p>
  
  <pre><code>@Autowired
  private FileRepositoryService repository;
  
  public Document getDocument(URL url) {
      MutableObject&lt;Document&gt; obj = new MutableObject&lt;&gt;();
      Consumer&lt;InputStream&gt; actionOnFile = inputStream -&gt; obj.setValue(getDocument(inputStream));
      try {
          repository.actionOnFile(url.toExternalForm(), actionOnFile);
      } catch (S3FileRepositoryException e) {
          throw e.getCause();
      }
      return obj.getValue();
  }
  </code></pre>
  
  <p>The problem is that the second argument is a lambda expression.</p>
  
  <p>How to mock it with mockito, I need to pass to the <code>accept</code> method  the input stream to test it? </p>