title: Mockito throw exception when object argument value matches pattern
body: <p>Seems simple but I can not come up with valid structure.</p>
  
  <p>I want to throw an exception whenever <code>Path</code> to the file contains certain regex. I have a list of files that I loop and whenever I come across invalid <code>Path</code> exception is thrown and file is not added to the list of successful files.</p>
  
  <p>Trying to test it with Mockito like:</p>
  
  <pre><code>    doThrow(DefaultException.class).when(service).foo(any(Path.class), any(Path.class));
  </code></pre>
  
  <p>where obviously I am missing the part where the excpetion would be thrown is for example the path has some certain regex in it as for now it is throwing exception for every file.</p>
  
  <p>Is there a way to replace <code>any(Path.class)</code> with something that would meet my needs?</p>