PageIterableResultAdapter extends AbstractIterableResultAdapter<Page> { @Override public boolean accepts(Invocation invocation, Object originalValue) { return originalValue instanceof Iterable && invocation.getMethod().getReturnType() .equals(Page.class); } PageIterableResultAdapter(); @Override boolean accepts(Invocation invocation, Object originalValue);  }
@Test public void testAccepting() throws Exception { final PageIterableResultAdapter adapter = new PageIterableResultAdapter(); assertThat(adapter.accepts(null, null), is(false)); assertThat(adapter.accepts( new ImmutableInvocation(ReturnTypeSampleRepository.class.getMethod("findOther"), new Object[]{}), new Object()), is(false)); assertThat(adapter.accepts( new ImmutableInvocation(ReturnTypeSampleRepository.class.getMethod("findPage"), new Object[]{}), new Object()), is(false)); assertThat(adapter.accepts( new ImmutableInvocation(ReturnTypeSampleRepository.class.getMethod("findPage"), new Object[]{}), new ArrayList<>()), is(true)); }