code: public void stop() throws IllegalStateException {
          if (!this.running) {
              throw new IllegalStateException("Can't stop StopWatch: it's not running");
          }
  
          if(!runningTasks.isEmpty()) {
  
              TaskInfo lastTask = runningTasks.pop();
              lastTask.stop();
              taskList.add(lastTask);
              this.currentTaskName = null;
              this.totalTimeMillis += lastTask.getTimeMillis();
          }
      }
docs: Stop the current task. The results are undefined if timing
  methods are called without invoking at least one pair
  {@link #start()} / {@link #stop()} methods.
  @see #start()