code: void unregister(ResourceMonitorImpl monitorImpl)
     {
        Set<Entry<WatchKey, ResourceMonitorImpl>> entrySet = keys.entrySet();
        Iterator<Entry<WatchKey, ResourceMonitorImpl>> iterator = entrySet.iterator();
        while (iterator.hasNext())
        {
           Entry<WatchKey, ResourceMonitorImpl> next = iterator.next();
           if (next.getValue() == monitorImpl)
           {
              next.getKey().cancel();
              iterator.remove();
           }
        }
     }
docs: Register the given directory with the WatchService