title: Using mockito any() throws java.lang.IllegalAccessError: class org.mockito.Matchers tried to access private method
body: <p>I'm facing the exception</p>
  <blockquote>
  <p>java.lang.IllegalAccessError: class org.mockito.Matchers tried to access private method 'void org.mockito.internal.progress.ThreadSafeMockingProgress.()' (org.mockito.Matchers and org.mockito.internal.progress.ThreadSafeMockingProgress are in unnamed module of loader 'app')</p>
  </blockquote>
  <blockquote>
  <p>at org.mockito.Matchers.(Matchers.java:107)</p>
  </blockquote>
  <p>when I try to use the matcher any() in mockito when() stub call. The class argument type is for &quot;NewOrder&quot; from the binance spot java library <a href="https://github.com/binance-exchange/binance-java-api/blob/master/src/main/java/com/binance/api/client/domain/account/NewOrder.java" rel="nofollow noreferrer">here</a></p>
  <p>I'm trying to do</p>
  <pre><code>when(mockBinanceApiRestClient.newOrder(any(NewOrder.class))).thenReturn(buyOrderResp);
  </code></pre>
  <p>mocking the <a href="https://github.com/binance-exchange/binance-java-api/blob/master/src/main/java/com/binance/api/client/BinanceApiRestClient.java" rel="nofollow noreferrer">BinanceApiRestClient</a>.
  The any() and when() are static imports from org.mockito.Mockito.
  This is such a nightmare why it wouldn't work. Any help is much appreciated.</p>