code: public void stop() {
          final boolean trace = TraceComponent.isAnyTracingEnabled();
  
          // Stop accepting work
          stopped = true;
  
          // Cancel futures for submitted work
          for (Future<Void> future = futures.poll(); future != null; future = futures.poll())
              if (!future.isDone() && future.cancel(true))
                  if (trace && tc.isDebugEnabled())
                      Tr.debug(this, tc, "canceled", future);
  
          // Release running work
          for (Work work = runningWork.poll(); work != null; work = runningWork.poll()) {
              if (trace && tc.isDebugEnabled())
                  Tr.debug(this, tc, "release", work);
              work.release();
          }
      }
docs: Provides a way to stop the WorkManager.