You should use Hamcrest's greaterThan
for this case. gt
is for verifying arguments of method calls in mock objects:
public class DemoTest {
private List<Integer> list = Mockito.mock(List.class);
@Test
public void testGreaterThan() throws Exception {
assertThat(17, is(org.hamcrest.Matchers.greaterThan(10)));
list.add(17);
verify(list).add(org.mockito.AdditionalMatchers.gt(10));
}
}