@Override
  public void close() {
    if (open.compareAndSet(true, false)) {
      queue.clear();
      queue.offer(poison);
    }
  }
Checks that the watch service is open, throwing {@link ClosedWatchServiceException} if not.
jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java