public ExecutionStateTracker create() {
    return new ExecutionStateTracker();
  }
@Test
  public void testErrorState() throws Exception {
    MillisProvider clock = mock(MillisProvider.class);
    ExecutionStateSampler sampler =
        new ExecutionStateSampler(
            PipelineOptionsFactory.fromArgs("--experiments=state_sampling_period_millis=10")
                .create(),
            clock);
    ExecutionStateTracker tracker = sampler.create();
    ExecutionState state1 =
        tracker.create("shortId1", "ptransformId1", "ptransformIdName1", "process");
    ExecutionState state2 =
        tracker.create("shortId2", "ptransformId2", "ptransformIdName2", "process");

    state1.activate();
    state2.activate();
    assertTrue(state2.error());
    assertFalse(state2.error());
    state2.deactivate();
    assertFalse(state2.error());
    tracker.reset();
    assertTrue(state1.error());
  }