LogObservable { @Pointcut(METHOD) public static boolean methodAnnotatedWithRxLogObservable(ProceedingJoinPoint joinPoint) { final FrodoProceedingJoinPoint frodoJoinPoint = new FrodoProceedingJoinPoint(joinPoint); final Annotation annotation = frodoJoinPoint.getAnnotation(RxLogObservable.class); return ((MethodSignature) joinPoint.getSignature()).getReturnType() == Observable.class && ((RxLogObservable)annotation).value() != RxLogObservable.Scope.NOTHING; }  @Pointcut(METHOD) static boolean methodAnnotatedWithRxLogObservable(ProceedingJoinPoint joinPoint); @Around("methodAnnotatedWithRxLogObservable(joinPoint)") Object weaveAroundJoinPoint(ProceedingJoinPoint joinPoint);  }
@Test public void shouldNotWeaveAroundMethodReturningOtherTypeThanObservable() { final TestJoinPoint joinPoint = new TestJoinPoint.Builder(this.getClass(), "toString") .withReturnType(this.getClass()).build(); final TestProceedingJoinPoint proceedingJoinPoint = new TestProceedingJoinPoint(joinPoint); assertThat(LogObservable.methodAnnotatedWithRxLogObservable(proceedingJoinPoint)).isFalse(); }