title: How to match a possible null parameter in Mockito
body: <p>I'm trying to verify that the class I'm testing calls the correct dependency class's method. So I'm trying to match the method parameters, but I don't really care about the actual values in this test, because I don't want to make my test brittle.</p>
  
  <p>However, I'm running into trouble setting it up because Mockito has decided that the behaviour I'm expecting is a bug: <a href="https://github.com/mockito/mockito/issues/134" rel="noreferrer">https://github.com/mockito/mockito/issues/134</a></p>
  
  <p>So what't the correct way to define an <code>ArgumentMatcher</code> for a parameter that might be <code>null</code>?</p>
  
  <p>With issue #134 "fixed", this code fails because the matchers only match in the first case. How can I define a matcher to work in all 4 cases?</p>
  
  <pre><code>MyClass c = mock(MyClass.class);
  
  c.foo("hello", "world");
  c.foo("hello", null);
  c.foo(null, "world");
  c.foo(null, null);
  
  verify(c, times(4)).foo(anyString(), anyString());
  </code></pre>