Marcos is right, but you have a couple of other options. First of all, there is either / or:
assertThat(result, either(is(1)).or(is(2)));
but if you have more than two elements, this is likely to become cumbersome. Plus, typechecker is sometimes weird in such things. For your case, you can do:
assertThat(result, isOneOf(1, 2, 3))
or if you already have your options in the / Collection array:
assertThat(result, isIn(theCollection))
See also Javadoc .
MatrixFrog Jul 02 '11 at 2:20 2011-07-02 02:20
source share