### Question:
SagaOrchestrator { @SuppressWarnings("unchecked") public <K> Result execute(K value) { state.cleanUp(); LOGGER.info(" The new saga is about to start"); var result = FINISHED; K tempVal = value; while (true) { var next = state.current(); var ch = saga.get(next); var srvOpt = sd.find(ch.name); if (srvOpt.isEmpty()) { state.directionToBack(); state.back(); continue; } var srv = srvOpt.get(); if (state.isForward()) { var processRes = srv.process(tempVal); if (processRes.isSuccess()) { next = state.forward(); tempVal = (K) processRes.getValue(); } else { state.directionToBack(); } } else { var rlRes = srv.rollback(tempVal); if (rlRes.isSuccess()) { next = state.back(); tempVal = (K) rlRes.getValue(); } else { result = CRASHED; next = state.back(); } } if (!saga.isPresent(next)) { return state.isForward() ? FINISHED : result == CRASHED ? CRASHED : ROLLBACK; } } } SagaOrchestrator(Saga saga, ServiceDiscoveryService sd); @SuppressWarnings("unchecked") Result execute(K value);  }### Answer:
@Test public void execute() { SagaOrchestrator sagaOrchestrator = new SagaOrchestrator(newSaga(), serviceDiscovery()); Saga.Result badOrder = sagaOrchestrator.execute("bad_order"); Saga.Result crashedOrder = sagaOrchestrator.execute("crashed_order"); Assert.assertEquals(badOrder, Saga.Result.ROLLBACK); Assert.assertEquals(crashedOrder, Saga.Result.CRASHED); }