title: Mocking generic scala method in mockito
body: <p>I'm working on a Scala project using Mockito as mocking framework. I wanted to mock the following generic Scala method:</p>
  
  <pre><code>def parseXml[T: ClassTag](xmlUrl: URL, xsdUrl: Option[URL]): Option[T] 
  </code></pre>
  
  <p>When mocking i assumed i could use on of Mockito's matchers like so:</p>
  
  <pre><code>when(xmlFileUnmarshallerMock.parseXml[org.mockito.Matchers.any[AddressBook]](org.mockito.Matchers.any[URL], org.mockito.Matchers.any[Option[URL]]))
      .thenReturn(Some(defaultAddressBook))
  </code></pre>
  
  <p>But it won't compile, then i tried both using [Any] and [AddressBook], but both results in the following error:</p>
  
  <pre><code>org.mockito.exceptions.misusing.InvalidUseOfMatchersException:  Invalid use of argument matchers! 3 matchers expected, 2 recorded.
  </code></pre>