@CanIgnoreReturnValue
    @Override
    public boolean reset() {
      // calling reset() multiple times without polling events would cause key to be placed in
      // watcher queue multiple times, but not much that can be done about that
      if (isValid() && state.compareAndSet(State.SIGNALLED, State.READY)) {
        // requeue if events are pending
        if (!events.isEmpty()) {
          signal();
        }
      }

      return isValid();
    }
Sets the state to SIGNALLED and enqueues this key with the watcher if it was previously in
the READY state.
jimfs/src/main/java/com/google/common/jimfs/AbstractWatchService.java