code: public synchronized void stop(final long stopInterval)
        throws IOException, InterruptedException {
      if (!running) {
        LOGGER.warn("Already stopped");
        return;
      }
      running = false;
  
  
      for (final PathAlterationObserver observer : observers) {
        observer.destroy();
      }
  
      executionResult.cancel(true);
      executor.shutdown();
      if (!executor.awaitTermination(stopInterval, TimeUnit.MILLISECONDS)) {
        throw new RuntimeException("Did not shutdown in the timeout period");
      }
    }
docs: Stop monitoring
  
  @param stopInterval the amount of time in milliseconds to wait for the thread to finish.
  A value of zero will wait until the thread is finished (see {@link Thread#join(long)}).
  @throws IOException if an error occurs initializing the observer
  @since 2.1