@Test
public void testTriggerInstanceStartTime() throws Exception {

  final List<DependencyInstance> dependencyInstanceList = new ArrayList<>();
  Date expectedStartTime = getDate(2, 2, 2);
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE, getDate(2, 2,
          2), getDate(2, 2, 3)));
  TriggerInstance ti = null;
  ti = new TriggerInstance("1", null, "1", 1,
      "test", dependencyInstanceList, -1, null);
  assertThat(ti.getStartTime()).isEqualTo(expectedStartTime.getTime());
  dependencyInstanceList.clear();
  ti = new TriggerInstance("1", null, "1", 1,
      "test", dependencyInstanceList, -1, null);
  assertThat(ti.getStartTime()).isEqualTo(0);
  dependencyInstanceList.clear();
  expectedStartTime = getDate(2, 2, 2);
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE, getDate(2, 2,
          4), getDate(2, 2, 3)));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE, getDate(2, 2,
          3), getDate(2, 2, 3)));
  dependencyInstanceList
      .add(createTestDependencyInstance(Status.SUCCEEDED, CancellationCause.NONE, getDate(2, 2,
          2), getDate(2, 2, 3)));
  ti = new TriggerInstance("1", null, "1", 1,
      "test", dependencyInstanceList, -1, null);
  assertThat(ti.getStartTime()).isEqualTo(expectedStartTime.getTime());
}