void (@NotNull WatchRequest request) { String watchRoot = request.getRootPath(); Map<String, List<WatchRequest>> roots = request.isToWatchRecursively() ? myRecursiveWatchRoots : myFlatWatchRoots; List<WatchRequest> requests = roots.get(watchRoot); if (requests != null) { requests.remove(request); if (requests.isEmpty()) { roots.remove(watchRoot); if (request.isToWatchRecursively()) { if (WatchRootsUtil.removeRecursivePath(myOptimizedRecursiveWatchRoots, myRecursiveWatchRoots, watchRoot)) { myWatcherRequiresUpdate = true; } } else if (!WatchRootsUtil.isCoveredRecursively(myOptimizedRecursiveWatchRoots, watchRoot)) { myWatcherRequiresUpdate = true; } } } }