title: throw checked Exceptions from mocks with Mockito
body: <p>I'm trying to have one of my mocked objects throw a checked Exception when a particular method is called. I'm trying the following.</p>
  
  <pre><code>@Test(expectedExceptions = SomeException.class)
  public void throwCheckedException() {
      List&lt;String&gt; list = mock(List.class);
      when(list.get(0)).thenThrow(new SomeException());
      String test = list.get(0);
  }
  
  public class SomeException extends Exception {
  }
  </code></pre>
  
  <p>However, that produces the following error.</p>
  
  <pre><code>org.testng.TestException: 
  Expected exception com.testing.MockitoCheckedExceptions$SomeException but got org.mockito.exceptions.base.MockitoException: 
  Checked exception is invalid for this method!
  Invalid: com.testing.MockitoCheckedExceptions$SomeException
  </code></pre>
  
  <p>Looking at the <a href="http://mockito.googlecode.com/svn/tags/1.8.5/javadoc/org/mockito/Mockito.html" rel="noreferrer">Mockito documentation</a>, they only use <code>RuntimeException</code>, is it not possible to throw checked Exceptions from a mock object with Mockito?</p>