### Question:
StagePresenter { public void setState(final State state) { if (state.equals(State.EXECUTING)) { view.setExecutingState(State.EXECUTING.name()); } else if (state.equals(State.DONE)) { view.setDoneState(State.DONE.name()); } else if (state.equals(State.ERROR)) { view.setErrorState(State.ERROR.name()); } else if (state.equals(State.STOPPED)) { view.setStoppedState(State.STOPPED.name()); } } @Inject  StagePresenter(final View view); @PostConstruct void init(); View getView(); void setup(final Stage stage); void setState(final State state);  }### Answer:
@Test public void testSetStateExecuting() { presenter.setState(State.EXECUTING); verify(view, times(1)).setExecutingState(State.EXECUTING.name()); }
@Test public void testSetStateDone() { presenter.setState(State.DONE); verify(view, times(1)).setDoneState(State.DONE.name()); }
@Test public void testSetStateError() { presenter.setState(State.ERROR); verify(view, times(1)).setErrorState(State.ERROR.name()); }
@Test public void testSetStateStopped() { presenter.setState(State.STOPPED); verify(view, times(1)).setStoppedState(State.STOPPED.name()); }