Just indicate that with Mockito you can also use additional Mockito and arguments
import static org.mockito.AdditionalMatchers.not; import static org.mockito.ArgumentMatchers.eq; //anything but not "ejb" mock.someMethod(not(eq("ejb")));
According to his documentation:
An example of using logical and (), not () or () matches:
// nothing but ejb
mock.someMethod (not (equiv ("EJB")));
There is more info on this other SO question
Hope help
troig source share