title: Create Mockito Array of some Object type
body: <p>I need to provide some mock object array of this type "TypeA[]".</p>
  
  <p>I am trying to do this but getting classcastexception:</p>
  
  <pre><code>List mockList = Mockito.anyListOf(TypeA.class);
  
  when(someService.create(Mockito.any(TypeB.class), (TypeA[])mockList.toArray())).thenReturn(1);
  </code></pre>