void (@NotNull List<? extends @NotNull VFileEvent> events) { boolean dirChanged = false; Set<VirtualFile> toRemove = new HashSet<>(); for (VFileEvent event : events) { if (event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent) { VirtualFile file = event.getFile(); if (file.isDirectory()) { dirChanged = true; } else { toRemove.add(file); } } } if (dirChanged) { clearInvalidFiles(); } for (VirtualFile file : toRemove) { myWolfTheProblemSolver.doRemove(file); } }