title: Mockito test a void method throws an exception
body: <p>I have a method with a <code>void</code> return type. It can also throw a number of exceptions so I'd like to test those exceptions being thrown. All attempts have failed with the same reason:</p>
  
  <blockquote>
    <p>The method when(T) in the type Stubber is not applicable for the arguments (void)</p>
  </blockquote>
  
  <p>Any ideas how I can get the method to throw a specified exception?</p>
  
  <pre><code>doThrow(new Exception()).when(mockedObject.methodReturningVoid(...));
  </code></pre>