PaginatedFlattrCallable extends AbstractFlattrCallable<R> { public abstract R call(FlattrService service, Integer count, Integer page) throws Exception;  void setCount(Integer count); Integer getCount(); void setPage(Integer page); Integer getPage(); abstract R call(FlattrService service, Integer count, Integer page); @Override R call(FlattrService service);  }
@Test public void testNullValues() throws Exception { final String expectedResult = "result321"; final FlattrService mockService = mock(FlattrService.class); PaginatedFlattrCallable<String> callable = new PaginatedFlattrCallable<String>() { @Override public String call(FlattrService service, Integer count, Integer page) throws Exception { assertThat(service, sameInstance(mockService)); assertThat(count, nullValue()); assertThat(page, nullValue()); executed = true; return expectedResult; } }; assertThat(callable, allOf( hasProperty("page", nullValue()), hasProperty("count", nullValue()) )); executed = false; String result = callable.call(mockService); assertThat(executed, is(true)); assertThat(result, sameInstance(expectedResult)); assertThat(callable, allOf( hasProperty("page", nullValue()), hasProperty("count", nullValue()) )); }