The same apply for verification.
Scroll down to see all methods - full list of matchers.

Warning:
If you are using argument matchers, all arguments have to be provided by matchers.
E.g: (example shows verification but the same applies to stubbing):

verify(mock).someMethod(anyInt(), anyString(), eq("third argument"));
//above is correct - eq() is also an argument matcher
verify(mock).someMethod(anyInt(), anyString(), "third argument");
//above is incorrect - exception will be thrown because third argument is given without argument matcher.

Matcher methods like anyObject(), eq()do not return matchers.
Internally, they record a matcher on a stack and return a dummy value (usually null).
This implementation is due to static type safety imposed by java compiler.
The consequence is that you cannot use anyObject(), eq() methods outside of verified/stubbed method.

Additional matchers

The class AdditionalMatchers offers rarely used matchers, although they can be useful, when
it is useful to combine multiple matchers or when it is useful to negate a matcher necessary.

Custom Argument ArgumentMatchers

It is important to understand the use cases and available options for dealing with non-trivial arguments
before implementing custom argument matchers. This way, you can select the best possible approach
for given scenario and produce highest quality test (clean and maintainable).
Please read on in the javadoc for ArgumentMatcher to learn about approaches and see the examples.

any

This matcher will perform a type check with the given type, thus excluding values.
See examples in javadoc for ArgumentMatchers class.
This is an alias of: isA(Class)}

Since Mockito 2.1.0, only allow non-null instance of , thus null is not anymore a valid value.
As reference are nullable, the suggested API to matchnull
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyBoolean

public static boolean anyBoolean()

Any boolean or non-nullBoolean

Since Mockito 2.1.0, only allow valued Boolean, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyByte

public static byte anyByte()

Any byte or non-nullByte.

Since Mockito 2.1.0, only allow valued Byte, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyChar

public static char anyChar()

Any char or non-nullCharacter.

Since Mockito 2.1.0, only allow valued Character, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyInt

public static int anyInt()

Any int or non-nullInteger.

Since Mockito 2.1.0, only allow valued Integer, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyLong

public static long anyLong()

Any long or non-nullLong.

Since Mockito 2.1.0, only allow valued Long, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyFloat

public static float anyFloat()

Any float or non-nullFloat.

Since Mockito 2.1.0, only allow valued Float, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyDouble

public static double anyDouble()

Any double or non-nullDouble.

Since Mockito 2.1.0, only allow valued Double, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyShort

public static short anyShort()

Any short or non-nullShort.

Since Mockito 2.1.0, only allow valued Short, thus null is not anymore a valid value.
As primitive wrappers are nullable, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyString

Since Mockito 2.1.0, only allow non-null String.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyList

Since Mockito 2.1.0, only allow non-null List.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyListOf

Deprecated.With Java 8 this method will be removed in Mockito 3.0. This method is only used for generic
friendliness to avoid casting, this is not anymore needed in Java 8.

Any non-nullList.
Generic friendly alias to anyList(). It's an alternative to
@SuppressWarnings("unchecked") to keep code clean of compiler warnings.

This method doesn't do type checks of the list content with the given type parameter, it is only there
to avoid casting in the code.

Since Mockito 2.1.0, only allow non-null List.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anySet

Since Mockito 2.1.0, only allow non-null Set.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

This method doesn't do type checks of the set content with the given type parameter, it is only there
to avoid casting in the code.

Since Mockito 2.1.0, only allow non-null Set.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyMap

Since Mockito 2.1.0, only allow non-null Map.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

This method doesn't do type checks of the map content with the given type parameter, it is only there
to avoid casting in the code.

Since Mockito 2.1.0, only allow non-null Map.
As this is a nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyCollection

Since Mockito 2.1.0, only allow non-null Collection.
As this is a nullable reference, the suggested API to matchnull
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

This method doesn't do type checks of the collection content with the given type parameter, it is only there
to avoid casting in the code.

Since Mockito 2.1.0, only allow non-null Collection.
As this is a nullable reference, the suggested API to matchnull
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

anyIterable

Since Mockito 2.1.0, only allow non-null Iterable.
As this is a nullable reference, the suggested API to matchnull
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

This method doesn't do type checks of the iterable content with the given type parameter, it is only there
to avoid casting in the code.

Since Mockito 2.1.0, only allow non-null String.
As strings are nullable reference, the suggested API to matchnull wrapper
would be isNull(). We felt this change would make tests harness much safer that it was with Mockito
1.x.

argThat

This API has changed in 2.1.0, please read ArgumentMatcher for rationale and migration guide.
NullPointerException auto-unboxing caveat is described below.

It is important to understand the use cases and available options for dealing with non-trivial arguments
before implementing custom argument matchers. This way, you can select the best possible approach
for given scenario and produce highest quality test (clean and maintainable).
Please read the documentation for ArgumentMatcher to learn about approaches and see the examples.

NullPointerException auto-unboxing caveat.
In rare cases when matching primitive parameter types you *must* use relevant intThat(), floatThat(), etc. method.
This way you will avoid NullPointerException during auto-unboxing.
Due to how java works we don't really have a clean way of detecting this scenario and protecting the user from this problem.
Hopefully, the javadoc describes the problem and solution well.
If you have an idea how to fix the problem, let us know via the mailing list or the issue tracker.