### Question:
BeforeAdvice { boolean isBeforeCalled() { return beforeCalled; }  void reset(); @Before("execution(void doSomething())") void entering(JoinPoint joinPoint);  }### Answer:
@Test public void beforeIsCalledIfCorrectMethodIsCalled() { assertFalse(beforeAspect.isBeforeCalled()); simpleService.doSomething(); assertTrue(beforeAspect.isBeforeCalled()); }
@Test public void beforeIsNotCalledIfDifferentMethodIsCalled() { assertFalse(beforeAspect.isBeforeCalled()); simpleService.returnsString(); assertFalse(beforeAspect.isBeforeCalled()); }