Mockito provides _argument matchers_ for flexibly stubbing or verifying method calls.
``++Mockito.verify()++``, ``++Mockito.when()++``, ``++Stubber.when()++`` and ``++BDDMockito.given()++`` each have overloads with and without argument matchers.
However, the default matching behavior (i.e. without argument matchers) uses ``++equals()++``. If only the matcher ``++org.mockito.ArgumentMatchers.eq()++`` is used, the call is equivalent to the call without matchers, i.e. the ``++eq()++`` is not necessary and can be omitted. The resulting code is shorter and easier to read.
=== on 6 Nov 2020, 17:07:19 Michael Gumowski wrote:
Rule idea contributed by Björn Duderstadt, in the community: \https://community.sonarsource.com/t/java-call-to-mockito-method-verify-when-or-given-can-be-simplified/33974