Suppose I have a class with two methods where I don\'t care which is called...
public class Foo {
public String getProperty(String key) {
return
You could use atLeast(0) in combination with ArgumentCaptor:
ArgumentCaptor propertyKeyCaptor = ArgumentCaptor.forClass(String.class);
Mockito.verify(foo, atLeast(0)).getProperty(propertyKeyCaptor.capture(), anyString());
ArgumentCaptor propertyKeyCaptor2 = ArgumentCaptor.forClass(String.class);
Mockito.verify(foo, atLeast(0)).getProperty(propertyKeyCaptor2.capture());
List propertyKeyValues = propertyKeyCaptor.getAllValues();
List propertyKeyValues2 = propertyKeyCaptor2.getAllValues();
assertTrue(!propertyKeyValues.isEmpty() || !propertyKeyValues2.isEmpty()); //JUnit assert -- modify for whatever testing framework you're using