### Question:
AfterAdvice { public boolean isAfterCalled() { return afterCalled; }  void reset(); boolean isAfterCalled(); @After("execution(* *(..))") void exiting(JoinPoint joinPoint);  }### Answer:
@Test public void afterAspectIsCalledIfMethodReturnsSuccessfully() { assertFalse(afterAdvice.isAfterCalled()); simpleService.doSomething(); assertTrue(afterAdvice.isAfterCalled()); }
@Test(expected = RuntimeException.class) public void afterAspectIsCalledIfMethodThrowsException() { assertFalse(afterAdvice.isAfterCalled()); try { simpleService.throwsRuntimeException(); } finally { assertTrue(afterAdvice.isAfterCalled()); } }