Probably need to change this to `if ( monitoringTask != null ) monitoringTask.cancel(true);`, because if `enableEvents` is true but creating a monitoringTask failed when the watch service is not supported on the current OS, then line 282 would result in an NPE.