### Question:
EndProcessListener extends AbstractProcessExecutionListener { @Override protected void notifyInternal(DelegateExecution execution) { if (isRootProcess(execution)) { eventHandler.handle(execution, Operation.State.FINISHED); } } @Inject  EndProcessListener(OperationInFinalStateHandler eventHandler);   }### Answer:
@Test void testNotifyInternal() { EndProcessListener endProcessListener = new EndProcessListener(eventHandler); VariableHandling.set(execution, Variables.CORRELATION_ID, execution.getProcessInstanceId()); endProcessListener.notifyInternal(execution); Mockito.verify(eventHandler) .handle(execution, Operation.State.FINISHED); }