title: Mockito Problems - InvalidUseOfMatchersException
body: <p>I am doing a test using mockito, but I am getting this problems:</p>
  
  <pre><code>org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
  Invalid use of argument matchers!
  2 matchers expected, 1 recorded:
  -&gt; at cl.gps.tms.planifications.planification.test.PlanificationCreateTest.setUp(PlanificationCreateTest.java:68)
  
  This exception may occur if matchers are combined with raw values:
      //incorrect:
      someMethod(anyObject(), "raw String");
  When using matchers, all arguments have to be provided by matchers.
  For example:
      //correct:
      someMethod(anyObject(), eq("String by matcher"));
  
  ...
  </code></pre>
  
  <p>The PlanificationCreateTest use the SimpleQueryBus for create a generic query where de first parameter indicates what type of object is returned, and second parameters are filters on the query.</p>
  
  <p>I want stub the SimpleQueryBus class (external library) returning a null (only for now)</p>
  
  <p>The SimpleQueryBus code</p>
  
  <pre><code>public class SimpleQueryBus implements QueryBus {
  
      public &lt;T, R&gt; R handle(Class&lt;R&gt; clazz, T query) throws Exception {
      ...
      }
  }
  </code></pre>
  
  <p>My test code</p>
  
  <pre><code>public class PlanificationCreateTest {
  
      private QueryBus queryBus;
  
      @Before
      public void setUp() throws Exception {
          queryBus = Mockito.mock(SimpleQueryBus.class);
  
          when(queryBus.handle(VehicleCollection.class, any(GetVehicle.class))).thenAnswer(null);
  
          ....
      }
  }
  </code></pre>
  
  <p><strong>UPDATE (SOLVED):</strong></p>
  
  <pre><code>public class PlanificationCreateTest {
  
      private QueryBus queryBus;
  
      @Before
      public void setUp() throws Exception {
          queryBus = Mockito.mock(SimpleQueryBus.class);
  
          // first example
          when(queryBus.handle(any(Class.class), isA(VehicleAvailable.class))).thenReturn(null);          
  
          // second example
          vehicle = new VehicleCollection("001", "name", "tag", "brand", "model");            
          when(queryBus.handle(any(Class.class), isA(GetVehicle.class))).thenReturn(vehicle);
  
          ....
      }
  }
  </code></pre>
  
  <p>Thanks...</p>