code: public static void watch(Thread thread, Runnable task) {
          if (thread == null) {
              throw new NullPointerException("thread");
          }
          if (task == null) {
              throw new NullPointerException("task");
          }
          if (!thread.isAlive()) {
              throw new IllegalArgumentException("thread must be alive.");
          }
  
          schedule(thread, task, true);
      }
docs: Schedules the specified {@code task} to run when the specified {@code thread} dies.
  
  @param thread the {@link Thread} to watch
  @param task the {@link Runnable} to run when the {@code thread} dies
  
  @throws IllegalArgumentException if the specified {@code thread} is not alive