title: Mockito Error Is Not Applicable for the Arguments (void)
body: <p>Mockito throws error <code>"The method when(T) in the type Stubber is not applicable for the arguments (void)"</code> for a class I'm mocking, can't figure out why.</p>
  
  <p>the code in question is: </p>
  
  <pre><code>Mockito.when(mockObject.myMethod(Mockito.any(MyExecutionContext.class))).thenReturn(value);
  </code></pre>
  
  <p>I'm aware similar questions have been asked but if somebody could explain a solution for this or point me in the right direction I would greatly appreciate it</p>