GeoPageIterableResultAdapter extends AbstractIterableResultAdapter<GeoPage> { @Override public boolean accepts(Invocation invocation, Object originalValue) { return originalValue instanceof Iterable && invocation.getMethod().getReturnType() .equals(GeoPage.class); } GeoPageIterableResultAdapter(); @Override boolean accepts(Invocation invocation, Object originalValue);  }
@Test public void testAccepting() throws Exception { final GeoPageIterableResultAdapter adapter = new GeoPageIterableResultAdapter(); 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("findGeoPage"), new Object[]{}), new Object()), is(false)); assertThat(adapter.accepts( new ImmutableInvocation(ReturnTypeSampleRepository.class.getMethod("findGeoPage"), new Object[]{}), new ArrayList<>()), is(true)); }