Evaluator { public static boolean isAfter() { if (LOGGER.isTraceEnabled()) { LOGGER.trace("isAfter returning " + (evaluationPhase.get() == EvaluationPhase.AFTER)); } return evaluationPhase.get() == EvaluationPhase.AFTER; }  @SuppressWarnings("unchecked") static T getCurrentTarget(); static boolean isBefore(); static boolean isAfter(); @SuppressWarnings("unchecked") static T getReturnValue(); static Object getPreCondition(Object target, String methodName, Class<?> contractClass,
			Class<?> callingClass, Class<?> returnType); static boolean canExecutePostCondition(); static boolean canExecuteCondition(); static Object getInvariant(Object target, String className, Class<?> contractClass, Class<?> callingClass); static void beforeContractMethod(); static Object getPostCondition(Object target, String methodName, Class<?> contractClass,
			Class<?> callingClass, Class<?> returnType, Object actualReturnValue); static Object getInitializationCall(Object target, String methodName, Class<?> contractClass,
			Class<?> callingClass); static void afterContract(); static void afterContractMethod(); @SuppressWarnings("unchecked") static T getConditionReturnValue(); static void setException(Throwable t); @SuppressWarnings("unchecked") static T getException(); static final StaticCall isBefore; static final String isBeforeDescriptor; static final StaticCall isAfter; static final StaticCall getReturnValue; static final StaticCall getCurrentTarget; static final StaticCall getPreCondition; static final StaticCall getPostCondition; static final StaticCall getInitializationCall; static final StaticCall getInvariant; static final StaticCall canExecuteCondition; static final StaticCall canExecutePostCondition; static final StaticCall beforeContractMethod; static final StaticCall afterContract; static final StaticCall afterContractMethod; static final StaticCall setException; }
@Test public void testIsAfter() { assertFalse(Evaluator.isAfter()); Evaluator.evaluationPhase.set(EvaluationPhase.BEFORE); assertFalse(Evaluator.isAfter()); Evaluator.evaluationPhase.set(EvaluationPhase.AFTER); assertTrue(Evaluator.isAfter()); }