title: Mockito matchers, scala value class and NullPointerException
body: <p>I'm using mockito with scalatest. I have following problem when using matcher with value class.</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>import org.scalatest.FlatSpec
  import org.scalatest.mock.MockitoSugar
  import org.mockito.BDDMockito._
  import org.mockito.Matchers.any
  
  case class FirstId(val value: String) extends AnyVal
  case class SecondId(val value: String) extends AnyVal
  
  trait MockedClass {
    def someMethods(firstId: FirstId, secondId: SecondId): Int
  }
  
  class ValueClassSpec() extends FlatSpec with MockitoSugar {
  
    val mockedClass = mock[MockedClass]
    val secondId = SecondId("secondId")
  
    "Matchers" should "work for value class" in {
      // given
      given(mockedClass.someMethods(any[FirstId], org.mockito.Matchers.eq(secondId))).willReturn(3)
      // when
      val result = mockedClass.someMethods(FirstId("firstId"), secondId)
      // then
      assert(result == 3)
    }
  
  }
  </code></pre>
  
  <p>and the result is:</p>
  
  <pre class="lang-java prettyprint-override"><code>ValueClassSpec:
  Matchers
  - should work for value class *** FAILED ***
    java.lang.NullPointerException:
    at io.scalac.fow.party.ValueClassSpec$$anonfun$1.apply$mcV$sp(ValueClassSpec.scala:22)
    at io.scalac.fow.party.ValueClassSpec$$anonfun$1.apply(ValueClassSpec.scala:20)
    at io.scalac.fow.party.ValueClassSpec$$anonfun$1.apply(ValueClassSpec.scala:20)
    at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
    at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
    at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
    at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
    at org.scalatest.Transformer.apply(Transformer.scala:22)
    at org.scalatest.Transformer.apply(Transformer.scala:20)
    at org.scalatest.FlatSpecLike$$anon$1.apply(FlatSpecLike.scala:1639)
    ...
  </code></pre>
  
  <p>I found similar question (<a href="https://stackoverflow.com/questions/19974493/scala-value-classes-and-mockito-matchers-dont-play-together">Scala Value classes and Mockito Matchers don&#39;t play together</a>) but without any advice.</p>
  
  <p>Is there any posibility to use mockito matchers with scala value class?</p>
  
  <p>Lib versions: scala 2.11.2, mockito 1.10.8, scalatest 2.1.6</p>