@Test
public void process() {

    SurveyInstanceStateMachine state = SurveyInstanceStateMachineFactory.simple("NOT_STARTED");
    assertEquals(IN_PROGRESS, state.process(SAVING, admin, survey));
    assertEquals(COMPLETED, state.process(SUBMITTING, admin, survey));
    assertEquals(APPROVED, state.process(APPROVING, admin, survey));
    assertEquals(IN_PROGRESS, state.process(REOPENING, admin, survey));
    assertEquals(WITHDRAWN, state.process(WITHDRAWING, admin, survey));
    assertEquals(IN_PROGRESS, state.process(REOPENING, admin, survey));
    assertEquals(COMPLETED, state.process(SUBMITTING, admin, survey));
    assertEquals(REJECTED, state.process(REJECTING, admin, survey));
}