public synchronized void reset() {
    if (trackedThread != null) {
      CURRENT_TRACKERS.remove(trackedThread.getId());
      trackedThread = null;
    }
    currentState = null;
    numTransitions = 0;
    millisSinceLastTransition = 0;
    transitionsAtLastSample = 0;
    nextLullReportMs = LULL_REPORT_MS;
  }
@Test
  public void testReset() throws Exception {
    ExecutionStateTracker tracker = createTracker();
    try (Closeable c1 = tracker.activate(new Thread())) {
      try (Closeable c2 = tracker.enterState(testExecutionState)) {
        sampler.doSampling(400);
        assertThat(testExecutionState.totalMillis, equalTo(400L));
      }
    }

    tracker.reset();
    assertThat(tracker.getTrackedThread(), equalTo(null));
    assertThat(tracker.getCurrentState(), equalTo(null));
    assertThat(tracker.getNumTransitions(), equalTo(0L));
    assertThat(tracker.getMillisSinceLastTransition(), equalTo(0L));
    assertThat(tracker.getTransitionsAtLastSample(), equalTo(0L));
    assertThat(tracker.getNextLullReportMs(), equalTo(TimeUnit.MINUTES.toMillis(5)));
  }