title: Mockito: Stubbing Methods That Return Type With Bounded Wild-Cards
body: <p>Consider this code:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class DummyClass {
      public List&lt;? extends Number&gt; dummyMethod() {
          return new ArrayList&lt;Integer&gt;();
      }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>public class DummyClassTest {
      public void testMockitoWithGenerics() {
          DummyClass dummyClass = Mockito.mock(DummyClass.class);
          List&lt;? extends Number&gt; someList = new ArrayList&lt;Integer&gt;();
          Mockito.when(dummyClass.dummyMethod()).thenReturn(someList); //Compiler complains about this
      }
  }
  </code></pre>
  
  <p>The compiler complains about the line that's trying to stub the behavior for <code>dummyMethod()</code>. Any pointers on how one goes about stubbing methods that return a type with bounded wild-cards?</p>