title: Mockito match any class argument
body: <p>Is there a way to match any class argument of the below sample routine?</p>
  
  <pre><code>class A {
       public B method(Class&lt;? extends A&gt; a) {}
  }
  </code></pre>
  
  <p>How can I <strong>always</strong> return a <code>new B()</code> regardless of which class is passed into <code>method</code>? The following attempt only works for the specific case where <code>A</code> is matched. </p>
  
  <pre><code>A a = new A();
  B b = new B();
  when(a.method(eq(A.class))).thenReturn(b);
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT</strong>: One solution is</p>
  
  <pre><code>(Class&lt;?&gt;) any(Class.class)
  </code></pre>