OutjectResult implements Interceptor { public boolean accepts(ResourceMethod method) { Type returnType = method.getMethod().getGenericReturnType(); return !returnType.equals(void.class); } OutjectResult(Result result, MethodInfo info, TypeNameExtractor extractor); boolean accepts(ResourceMethod method); void intercept(InterceptorStack stack, ResourceMethod method, Object resourceInstance);  }
@Test public void shouldNotOutjectIfThereIsNoReturnType() throws NoSuchMethodException { when(method.getMethod()).thenReturn(MyComponent.class.getMethod("noReturn")); assertFalse(interceptor.accepts(method)); }
@Test public void shouldNotOutjectIfReturnIsVoid() throws NoSuchMethodException { when(method.getMethod()).thenReturn(MyComponent.class.getMethod("returnsAString")); assertTrue(interceptor.accepts(method)); }