While I was writing some unit test, I came to a point when I needed to instrument a mock to return a given result if the input parameter was a not empty list. It was not essential to know which values the list stores. The only important thing is that it is not empty.
I am using Mockito, and I am searching for something like the following.
when(mock.someMethod(anyNotEmptyList(String.class))).thenReturn(42);
I googled a little, but I cannot find anything.