### Question:
HooksPhaseGetter { public List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context) { if (syncFlowableStep instanceof AfterStepHookPhaseProvider) { return ((AfterStepHookPhaseProvider) syncFlowableStep).getHookPhasesAfterStep(context); } return Collections.singletonList(HookPhase.NONE); }  List<HookPhase> getHookPhasesBeforeStop(SyncFlowableStep syncFlowableStep, ProcessContext context); List<HookPhase> getHookPhasesAfterStop(SyncFlowableStep syncFlowableStep, ProcessContext context);  }### Answer:
@Test void testGetHookPhasesAfterStop() { List<HookPhase> hookPhases = List.of(HookPhase.AFTER_STOP); StopAppStep afterStepHookPhaseProvider = Mockito.mock(StopAppStep.class); Mockito.when(afterStepHookPhaseProvider.getHookPhasesAfterStep(context)) .thenReturn(hookPhases); List<HookPhase> hookPhasesBeforeStop = hooksPhaseGetter.getHookPhasesAfterStop(afterStepHookPhaseProvider, context); Assertions.assertEquals(1, hookPhasesBeforeStop.size()); Assertions.assertEquals(hookPhases, hookPhasesBeforeStop); }
@Test void testGetHookPhasesAfterStopNonHooksClass() { SyncFlowableStep syncFlowableStep = Mockito.mock(SyncFlowableStep.class); List<HookPhase> hookPhasesAfterStop = hooksPhaseGetter.getHookPhasesAfterStop(syncFlowableStep, context); Assertions.assertEquals(1, hookPhasesAfterStop.size()); Assertions.assertEquals(HookPhase.NONE, hookPhasesAfterStop.get(0)); }