Suppose I am having this object objectDemo which calls to the method objectDemoMethod with 2 parameters String and null.
isNull seems to be 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.
I think you could use nullable:
public static T nullable(Class clazz) You could use something like:
verify(objectDemo, times(1)).objectDemoMethod(any(String.class), nullable(String.class));