import java.util.function.Consumer; import org.assertj.core.matcher.AssertionMatcher; import org.mockito.hamcrest.MockitoHamcrest; public class CustomMatchers { private CustomMatchers() {} public static T argSatisfying(Consumer assertions) { return MockitoHamcrest.argThat( new AssertionMatcher() { public void assertion(T actual) throws AssertionError { assertions.accept(actual); } }); } } // verify(aMock).aMethod(argThat(actual -> assertThat(actual).containsExactlyInAnyOrder(aValue, anotherValue)));