What's the usage of Easymock.and(int, int)?
EasyMock has predefined argument matcher and(X first, X second)
Document says:
Matches if the matchers used in fir开发者_如何转开发st 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?
The point is to use other matchers inside the and. Like and(lt(8), gt(4))
精彩评论