### Question:
Transition { public Context getContext() { return context; } @JsonCreator private  Transition(
            @JsonProperty("transitioned") LocalDateTime transitioned,
            @JsonProperty("state") String state,
            @JsonProperty("event") String event,
            @JsonProperty("previous") Transition previous,
            @JsonProperty("context") Context context); static Transition initialTransition(String stateMachineId,
                                               Object initialState,
                                               List<Object> initialContexts); @JsonIgnore Optional<Transition> previous(); @JsonIgnore String getEvent(); @JsonIgnore Object getState(); LocalDateTime getTransitioned(); Context getContext(); @Override String toString(); static Transition To(Object state, Object event, Context context); static Transition To(Class<?> state, Object event, Context context); Transition setPrevious(Transition previous);  }### Answer:
@Test public void shouldContainInitialUserValues() { final List<TestInitialContext> testContexts = initialTransition.getContext().getContextsOfType(TestInitialContext.class); assertThat(testContexts.size(), equalTo(1)); }
@Test public void shouldMutateAndAppendONLYCanUnlockContextToSupportUnlockingWithinFinalStateOnEnter() { initialTransition.getContext().addCanUnlock(new TestCanUnlock()); final List<CanUnlock> contexts = initialTransition.getContext().getContextsOfType(CanUnlock.class); assertThat(contexts.size(), equalTo(1)); }
@Test public void shouldNormalContextsOnlyExistInTransitionedAndNotMutateExisting() { assertThat(initialTransition.getContext().getContextsOfType(PinRechargedContext.class).size(), equalTo(0)); assertThat(transitioned.getContext().getContextsOfType(PinRechargedContext.class).size(), equalTo(1)); }