VoidResultAdapter extends AbstractResultAdapter<Object> { @Override public boolean accepts(Invocation invocation, Object originalValue) { return void.class.equals(invocation.getMethod().getReturnType()); } VoidResultAdapter(); @Override boolean accepts(Invocation invocation, Object originalValue); @Override Object adapt(Invocation invocation, Object originalValue);  }
@Test public void testAccepting() throws Exception { final VoidResultAdapter adapter = new VoidResultAdapter(); assertThat(adapter.accepts( new ImmutableInvocation(ReturnTypeSampleRepository.class.getMethod("findOther"), new Object[]{}), null), is(false)); assertThat(adapter.accepts( new ImmutableInvocation(ReturnTypeSampleRepository.class.getMethod("doSomething"), new Object[]{}), null), is(true)); }