@Test
public void testHasTransition() {

    TaskStatus checked = TaskStatus.newBuilder().withState(TaskState.KillInitiated).withTimestamp(1000).build();
    Task task = REFERENCE_TASK.toBuilder()
            .withStatus(checked)
            .withStatusHistory(
                    TaskStatus.newBuilder().withState(TaskState.Accepted).withTimestamp(0).build(),
                    TaskStatus.newBuilder().withState(TaskState.Launched).withTimestamp(100).build(),
                    TaskStatus.newBuilder().withState(TaskState.StartInitiated).withReasonCode("step1").withTimestamp(100).build(),
                    TaskStatus.newBuilder().withState(TaskState.StartInitiated).withReasonCode("step2").withTimestamp(100).build()
            )
            .build();
    assertThat(JobFunctions.containsExactlyTaskStates(task, TaskState.Accepted, TaskState.Launched, TaskState.StartInitiated, TaskState.KillInitiated)).isTrue();
}