### Question:
InitialTransition { public static Transition initialTransition(Transition transition) { Transition curr = transition; while (curr.previous().isPresent()) { curr = curr.previous().get(); } return curr; }  static Transition initialTransition(Transition transition);  }### Answer:
@Test public void shouldRetrieveInitialTransitionWhenTransitionIsSubsequent() { final Transition calculatedInitial = InitialTransition.initialTransition(transitioned); assertThat(calculatedInitial, notNullValue()); assertThat(calculatedInitial, equalTo(initialTransition)); }
@Test public void shouldRetrieveInitialTransitionWhenTransitionIsInitial() { final Transition calculatedInitial = InitialTransition.initialTransition(initialTransition); assertThat(calculatedInitial, notNullValue()); assertThat(calculatedInitial, equalTo(initialTransition)); }