Question

EasyMock has predefined argument matcher and(X first, X second)

Document says:

Matches if the matchers used in first and second both match. Available for all primitive types and for objects.

But I don't understand what's the use case for the numberical type and matcher. For example, and(int first, int second), it's meaningless if first not equals to second, how can an integer equals both first and second while first and second are different value?

Was it helpful?

Solution

The point is to use other matchers inside the and. Like and(lt(8), gt(4))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top